



























var 
gsAgent=navigator.userAgent.toLowerCase(),
gsAppVer=navigator.appVersion.toLowerCase(),
gsAppName=navigator.appName.toLowerCase(),
gbIsOpera=gsAgent.indexOf("opera")>-1,
gbIsWebKit=gsAgent.indexOf("applewebkit")>-1,
gbIsKHTML=gsAgent.indexOf("khtml")>-1
||gsAgent.indexOf("konqueror")>-1||gbIsWebKit,
gbIsIE=(gsAgent.indexOf("compatible")>-1&&!gbIsOpera)
||gsAgent.indexOf("msie")>-1,
gbIsTT=gbIsIE?(gsAppVer.indexOf("tencenttraveler")!=-1?1:0):0,
gbIsQBWebKit=gbIsWebKit?(gsAppVer.indexOf("qqbrowser")!=-1?1:0):0,
gbIsQPlus=gsAgent.indexOf("qplus")>-1,
gbIsChrome=gbIsWebKit&&!gbIsQBWebKit&&gsAgent.indexOf("chrome")>-1&&gsAgent.indexOf("se 2.x metasr 1.0")<0&&!gbIsQPlus,
gbIsSafari=gbIsWebKit&&!gbIsChrome&&!gbIsQBWebKit,
gbIsQBIE=gbIsIE&&gsAppVer.indexOf("qqbrowser")!=-1,
gbIsFF=gsAgent.indexOf("gecko")>-1&&!gbIsKHTML,
gbIsNS=!gbIsIE&&!gbIsOpera&&!gbIsKHTML&&(gsAgent.indexOf("mozilla")==0)
&&(gsAppName=="netscape"),
gbIsAgentErr=!(gbIsOpera||gbIsKHTML||gbIsSafari||gbIsIE||gbIsTT
||gbIsFF||gbIsNS),
gbIsWin=gsAgent.indexOf("windows")>-1||gsAgent.indexOf("win32")>-1,
gbIsVista=gbIsWin&&(gsAgent.indexOf("nt 6.0")>-1||gsAgent.indexOf("windows vista")>-1),
gbIsWin7=gbIsWin&&gsAgent.indexOf("nt 6.1")>-1,
gbIsMac=gsAgent.indexOf("macintosh")>-1||gsAgent.indexOf("mac os x")>-1,
gsMacVer=/mac os x (\d+)(\.|_)(\d+)/.test(gsAgent)&&parseFloat(RegExp.$1+"."+RegExp.$3),
gbIsLinux=gsAgent.indexOf("linux")>-1,
gbIsAir=gsAgent.indexOf("adobeair")>-1,
gnIEVer=/MSIE (\d+.\d+);/i.test(gsAgent)&&parseFloat(RegExp["$1"]),
gsFFVer=/firefox\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"],
gsSafariVer=""+(/version\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"]),
gsChromeVer=""+(/chrome\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"]),
gsQBVer=""+(/qqbrowser\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"]),

aDV="_For_E_Built";




if(document.domain!="qq.com"||!window.getTop)
{
document.domain="qq.com";






function getTop()
{
var yK=arguments.callee;

if(!yK.agd)
{
try
{
if(window!=parent)
{
yK.agd=parent.getTop?parent.getTop():parent.parent.getTop();
}
else
{
yK.agd=window;
}
}
catch(bc)
{
yK.agd=window;
}
}

return yK.agd;
};

window.getTop=getTop;
}







function callBack(bC,nI)
{
if(!window.Console)
{
try
{
return callBack.XF.call(this,bC,nI);
}
catch(bc)
{
debug(bc.message);
}
}
else
{
return callBack.XF.call(this,bC,nI);
}
}







callBack.XF=function(bC,nI)
{
return typeof bC=="function"
?bC.apply(this,nI||[]):null;
};









function waitFor(Tq,GE,
Cu,pz)
{
var eV=0,
oR=Cu||500,
Sl=(pz||10*500)/oR;

function aGZ(oM)
{
try
{
GE(oM)
}
catch(bc)
{
debug(bc,2);
}
};

(function()
{
try
{
if(Tq())
{
return aGZ(true);
}
}
catch(bc)
{
debug(bc,2);
}

if(eV++>Sl)
{
return aGZ(false);
}

setTimeout(arguments.callee,oR);
})();
}






function unikey(Fi)
{
return[Fi,now(),Math.random()].join("").split(".").join("");
}




function genGlobalMapIdx()
{
return Math.round(Math.random()*10000).toString()+new Date().getMilliseconds();
}






function isLeapYear(ge)
{
return(ge%400==0||(ge%4==0&&ge%100!=0));
}







function calDays(ge,hW)
{
return[null,31,null,31,30,31,30,31,31,30,31,30,31][hW]||(isLeapYear(ge)?29:28);
}





function now()
{
return+new Date;
}






function trim(bG)
{
return(bG&&bG.replace?bG:"").replace(/(^\s*)|(\s*$)/g,"");
}

function trim2(bG)
{


if(bG&&bG.substring)
{
var rb=/\s/,CD=-1,Cz=bG.length;
while(rb.test(bG.charAt(--Cz)));
while(rb.test(bG.charAt(++CD)));
return bG.substring(CD,Cz+1);
}

}












function strReplace(bG,Ox,bNv,cX)
{
return(bG||"").replace(
new RegExp(regFilter(Ox),cX),bNv);
}






function encodeURI(bG)
{
return bG&&bG.replace?bG.replace(/%/ig,"%25").replace(/\+/ig,"%2B")
.replace(/&/ig,"%26").replace(/#/ig,"%23")
.replace(/\'/ig,"%27").replace(/\"/ig,"%22"):bG;
}






function decodeURI(bG)
{
return decodeURIComponent(bG||"");
}






function regFilter(Ts)
{
return Ts.replace(/([\^\.\[\$\(\)\|\*\+\?\{\\])/ig,"\\$1");
}






function isUrl(fm)
{
return(fm||"").replace(
/http?:\/\/[\w.]+[^ \f\n\r\t\v\"\\\<\>\[\]\u2100-\uFFFF]*/,"url")=="url";
}













function cookQueryString(bj,ay)
{
var cM=bj.split("#"),
xv=cM[1]?("#"+cM[1]):"";

bj=cM[0];

for(var i in ay)
{
var bV=ay[i],
dU=new RegExp(["([?&]",i,"=)[^&#]*"].join(""),"gi");

bj=dU.test(bj)?
bj.replace(dU,"$1"+bV):[bj,"&",i,"=",bV,xv].join("");
}
return bj;
}









function formatNum(lp,aOA)
{
var wq=(isNaN(lp)?0:lp).toString(),
ajF=aOA-wq.length;
return ajF>0?[new Array(ajF+1).join("0"),wq].join(""):wq;
}







function numToStr(lp,caf)
{
var wq=String(lp.toFixed(caf));
var re=/(-?\d+)(\d{3})/;
while(re.test(wq))
{
wq=wq.replace(re,"$1,$2");
}
return wq;
}




function numToTimeStr(lp,Er)
{
var HS=Er||"$HH$:$MM$:$SS$";
return	T(HS).replace({
SS:formatNum(parseInt(lp)%60,2),
MM:formatNum(parseInt(lp/60)%60,2),
HH:formatNum(parseInt(lp/3600)%60,2)
})
}








function formatDate(oZ,Er,bPv)
{
var cZ=oZ||new Date(),
Vz=formatNum;

return T(Er,bPv).replace({
YY:Vz(cZ.getFullYear(),4),
MM:Vz(cZ.getMonth()+1,2),
DD:Vz(cZ.getDate(),2),
hh:Vz(cZ.getHours(),2),
mm:Vz(cZ.getMinutes(),2),
ss:Vz(cZ.getSeconds(),2)
});
}







function getAsiiStrLen(bG)
{
return(bG||"").replace(/[^\x00-\xFF]/g,"aa").length;
}





function clearHtmlStr(bG)
{
return bG?bG.replace(/<[^>]*>/g,""):bG;
}








function subAsiiStr(bG,vp,Vt,Ey)
{
var DY=function(fm){return fm},
EG=Ey?htmlEncode:DY,
fG=(Ey?htmlDecode:DY)(trim((bG||"").toString())),
Ad=Vt||"",
ML=Math.max(vp-Ad.length,1),
VW=fG.length,
wE=0,
vo=-1,
qr;

for(var i=0;i<VW;i++)
{
qr=fG.charCodeAt(i);


wE+=qr==35||qr==87
?1.2
:(qr>255?1.5:1);

if(vo==-1&&wE>ML)
{
vo=i;
}

if(wE>vp)
{
return EG(fG.substr(0,vo))+Ad;
}
}

return EG(fG);
}













function setCookie(aD,bJ,mQ,eP,kK,pL)
{
if(aD)
{
document.cookie=T(
[
'$name$=$value$; ',
!mQ?'':'expires=$expires$; ',
'path=$path$; ',
'domain=$domain$; ',
!pL?'':'$secure$'
]
).replace(
{
name:aD,
value:encodeURIComponent(bJ||""),
expires:mQ&&mQ.toGMTString(),
path:eP||'/',
domain:kK||["mail.",getDomain()].join(""),
secure:pL?"secure":""
}
);
return true;
}
else
{
return false;
}
}






function getCookie(aD)
{
var iP=(new RegExp(["(^|;|\\s+)",regFilter(aD),"=([^;]*);?"].join("")));

if(iP.test(document.cookie))
{

try
{
return decodeURIComponent(RegExp["$2"]);
}
catch(e)
{
return RegExp["$2"];
}
}
}







function deleteCookie(aD,eP,kK)
{
setCookie(aD,"",new Date(0),eP,kK);
}









function setCookieFlag(aD,dk,CB,aBc)
{
var jk=aBc||getCookieFlag(aD),
NS=new Date();


NS.setTime(NS.getTime()+(30*24*3600*1000));
jk[dk]=CB;
setCookie(aD,jk.join(""),NS);

return jk;
}






function getCookieFlag(aD)
{
var anQ=(getCookie(aD)||"").split("");

for(var i=anQ.length;i<6;i++)
{
anQ[i]='0';
}

return anQ;
}








function isArr(ay)
{
return Object.prototype.toString.call(ay)=="[object Array]";
}









function E(Li,ZQ,avJ,XN)
{
if(!Li)
{
return;
}

if(Li.length!=null)
{
var _nLen=Li.length,
he;

if(XN<0)
{
he=_nLen+XN;
}
else
{
he=XN<_nLen?XN:_nLen;
}

for(var i=(avJ||0);i<he;i++)
{
try
{
if(ZQ(Li[i],i,_nLen)===false)
{
break;
}
}
catch(bc)
{
debug([bc.message,"<br>line:",bc.lineNumber,'<br>file:',bc.fileName,"<br>",ZQ]);
}
}
}
else
{
for(var i in Li)
{
try
{
if(ZQ(Li[i],i)===false)
{
break;
}
}
catch(bc)
{
debug([bc.message,"<br>",ZQ]);
}
}
}
}









function extend()
{
for(var aZ=arguments,tY=aZ[0],i=1,_nLen=aZ.length;i<_nLen;i++)
{
var zd=aZ[i];
for(var j in zd)
{
tY[j]=zd[j];
}
}
return tY;
}







function delAtt(aC,Wo)
{
try
{
delete aC[Wo];
}
catch(bc)
{
}
return aC;
}







function saveAtt(aC,Wo)
{
if(aC)
{
var bRJ=aC.hasOwnProperty(Wo),
fI=aC[Wo];
return function()
{
if(bRJ)
{
aC[Wo]=fI;
}
else
{
delAtt(aC,Wo);
}
return aC;
};
}
else
{
return function(){};
}
}









function globalEval(gp,uJ)
{
var Od=getTop().globalEval||arguments.callee;

if(!Od.aDI&&typeof(Od.aZP)!="boolean")
{
var aU="testScriptEval"+now();

Od.aDI=true;
Od(T('window.$id$=1;').replace({
id:aU
}));
Od.aDI=false;

Od.aZP=getTop()[aU]?true:false;
}

var iw=trim(gp);
if(!iw)
{
return false;
}

var aM=(uJ||window).document,
tg=GelTags("head",aM)[0]||aM.documentElement,
eK=aM.createElement("script");

eK.type="text/javascript";
if(Od.aZP||arguments.callee.aDI)
{
try
{
eK.appendChild(aM.createTextNode(iw));
}
catch(bc)
{
}
}
else
{

eK.text=iw;
}

tg.insertBefore(eK,tg.firstChild);
tg.removeChild(eK);

return true;
}





function evalValue(gp,uJ)
{
var bm=unikey("_u"),
az=uJ||window,
jk;

globalEval(
[
"(function(){try{window.",bm,"=",gp,";}catch(_oError){}})();"
].join(""),
az
);
jk=az[bm];
az[bm]=null;

return jk;
}







function evalCss(bNj,uJ,aox)
{
if(bNj)
{
var aM=uJ?uJ.document||uJ:document,
bUL="cssfrom",
cBf="style",
Zg=aM.getElementsByTagName(cBf)[0];

if(aox&&Zg)
{
var jg=Zg.getAttribute(bUL)||"";
if(jg.indexOf(aox)!=-1)
{
return;
}
}

if(aM.createStyleSheet)
{
Zg=Zg||aM.createStyleSheet().owningElement;
Zg.styleSheet.cssText+=getRes(bNj);
}
else
{

if(!Zg)
{
var _oHeader=aM.getElementsByTagName("head")[0];
Zg=aM.createElement(cBf);
Zg.type="text/css";
_oHeader.insertBefore(Zg,_oHeader.firstChild);
}
Zg.textContent+=getRes(bNj);
}
aox&&Zg.setAttribute(
bUL,[Zg.getAttribute(bUL)||"",aox].join(",")
);
}
}







function S(aI,dJ)
{
try
{
return(dJ&&(dJ.document||dJ)
||document).getElementById(aI);
}
catch(bc)
{
return null;
}
}







function SN(aD,dJ)
{
try
{
var Pi=(dJ&&(dJ.document||dJ)
||document).getElementsByName(aD);
if(Pi)
{
Pi[aDV]=true;
}
return Pi;
}
catch(bc)
{
return null;
}
}









function attr(_aoDom,dS,bJ)
{

if(!_aoDom||!_aoDom.nodeType||_aoDom.nodeType===3||_aoDom.nodeType===8)
{
return undefined;
}
if(bJ===undefined)
{
return _aoDom.getAttribute(dS);
}
else
{
_aoDom.setAttribute(dS,bJ);
return _aoDom;
}
}







function GelTags(hJ,bz)
{
var Pi=(bz||document).getElementsByTagName(hJ);
if(Pi)
{
Pi[aDV]=true;
}
return Pi;

}







function CN(aaq,_aoDom,jE)
{
_aoDom=_aoDom||document;

if(_aoDom.getElementsByClassName)
{
return _aoDom.getElementsByClassName(aaq);
}
else
{
jE=jE||"*";
var fZ=[],
amn=(jE=='*'&&_aoDom.all)?_aoDom.all:_aoDom.getElementsByTagName(jE),
i=amn.length;
aaq=aaq.replace(/\-/g,'\\-');
var iP=new RegExp('(^|\\s)'+aaq+'(\\s|$)');
while(--i>=0)
{
if(iP.test(amn[i].className))
{
fZ.push(amn[i]);
}
}
return fZ;
}
};







function F(aI,ao)
{
var DJ=S(aI,ao);
return DJ&&(DJ.contentWindow||(ao||window).frames[aI]);
}

function appendToUrl(bj,bRv)
{
var cM=bj.split("#");
return[cM[0],bRv,(cM.length>1?"#"+cM[1]:"")].join("");
}









function insertHTML(bz,eY,cB)
{
if(!bz)
{
return false;
}
try
{

if(bz.insertAdjacentHTML)
{
bz.insertAdjacentHTML(eY,cB);
}
else
{
var dB=bz.ownerDocument.createRange(),
kZ=eY.indexOf("before")==0,
EC=eY.indexOf("Begin")!=-1;
if(kZ==EC)
{
dB[kZ?"setStartBefore":"setStartAfter"](bz);
bz.parentNode.insertBefore(
dB.createContextualFragment(cB),EC
?bz
:bz.nextSibling
);
}
else
{
var dD=bz[kZ?"lastChild":"firstChild"];
if(dD)
{
dB[kZ?"setStartAfter":"setStartBefore"](dD);
bz[kZ?"appendChild":"insertBefore"](dB
.createContextualFragment(cB),dD);
}
else
{

bz.innerHTML=cB;
}
}
}
return true;
}
catch(bc)
{

return false;
}
}

















function setHTML(apI,cB)
{
var arA=typeof apI==="string"?S(apI):apI,
apu=arA.cloneNode(false);
apu.innerHTML=cB;
arA.parentNode.replaceChild(apu,arA);
return apu;
}



















function createIframe(ao,qQ,cd)
{
var aeP="_creAteifRAmeoNlQAd_",
cS=cd||{},
aU=cd.id||unikey(),
vO=S(aU,ao);


typeof ao[aeP]!="function"&&
(ao[aeP]=function(aI,bQe)
{
callBack.call(bQe,arguments.callee[aI],[ao]);
}
);


ao[aeP][aU]=cd.onload;
if(!vO)
{
insertHTML(
cS.obj||ao.document.body,
cS.where||"afterBegin",
TE([
'<iframe frameborder="0" scrolling="$scrolling$" id="$id$" name="$id$" ',
'$@$if($transparent$)$@$allowTransparent$@$endif$@$ class="$className$" ',
'onload="this.setAttribute(\x27loaded\x27,\x27true\x27);$cb$(\x27$id$\x27,this);" ',
'src="$src$" style="$style$" $attrs$>',
'</iframe>'
]).replace(extend(
{
"id":aU,
"cb":aeP,
style:"display:none;",
scrolling:"no",
src:qQ
}
,cd))
);
vO=S(aU,ao);
vO.aMd=cd.onload;
}
else if(vO.getAttribute("loaded")=="true")
{
ao[aeP](aU,vO);
}

return vO;
}





function removeSelf(bz)
{
try
{
bz.parentNode.removeChild(bz);
}
catch(bc)
{
}

return bz;
}







function isObjContainTarget(bz,eG)
{
try
{
if(!bz||!eG)
{
return false;
}
else if(bz.contains)
{
return bz.contains(eG);
}
else if(bz.compareDocumentPosition)
{
var ED=bz.compareDocumentPosition(eG);
return(ED==20||ED==0);
}
}
catch(Bq)
{


}

return false;
}






function isDisableCtl(aDY,ao)
{
var aYt=SN(aDY,ao);
for(var i=aYt.length-1;i>=0;i--)
{
if(aYt[i].disabled)
{
return true;
}
}
return false;
}







function disableCtl(aDY,sW,dJ)
{
E(SN(aDY,dJ),function(cbK)
{
cbK.disabled=sW;
}
);
}








function isShow(sm,dJ)
{
return(getStyle((typeof(sm)=="string"?S(sm,dJ):sm),"display")||"none")
!="none";
}







function show(sm,nh,dJ)
{
var dD=(typeof(sm)=="string"?S(sm,dJ):sm);
if(dD)
{
dD.style.display=(nh?"":"none");
}
else if(!dJ&&typeof(sm)=="string")
{

}
return dD;
}


var Show=show;





function toggle(sm,dJ)
{
return show(sm,!isShow(sm,dJ),dJ);
}







function setClass(bz,pS)
{
if(bz&&typeof(pS)!="undefined"&&bz.className!=pS)
{
bz.className=pS;
}
return bz;
}







function addClass(bz,pS)
{
if(bz)
{
var iJ=" "+bz.className+" ";
if(iJ.indexOf(" "+pS+" ")<0)
{
bz.className+=bz.className?" "+pS:pS;
}
}
return bz;
};







function rmClass(bz,pS)
{
if(bz)
{
if(pS)
{
var iJ=" "+bz.className+" ";
iJ=iJ.replace(" "+pS+" "," ");
bz.className=trim(iJ);
}
else
{
bz.className="";
}
}
return bz;
};





function hasClass(bz,pS)
{
return bz&&(" "+bz.className+" ").indexOf(" "+pS+" ")>-1;
};







function getStyle(bz,aUb)
{
var qo=bz&&(bz.currentStyle
?bz.currentStyle
:bz.ownerDocument.defaultView.getComputedStyle(bz,null));
return qo&&qo[aUb]||"";
}







function setOpacity(bz,Yw)
{
if(bz&&bz.tagName)
{
var cL=bz.style,
ph=Yw||0;











if(typeof cL.opacity=="undefined")
{
cL.filter=ph==1
?"":["alpha(opacity=",ph*100,")"].join("");
}
else
{
cL.opacity=ph;
}
}
return bz;
}






function getOpacity(bz,Yw)
{
if(bz&&bz.tagName)
{
var cL=bz.style,
ph=1;









if(typeof cL.opacity=="undefined")
{
ph=parseFloat(cL.filter.split("=").pop())/100;
}
else
{
ph=parseFloat(cL.opacity);
}

if(isNaN(ph))
{
ph=1;
}
}
return ph;
}






function getStrDispLen(bG)
{
var baa="__QMStrCalcer__";
var amh=S(baa,getTop());
if(!amh)
{
var cz=getTop().document.body;
insertHTML(
cz,
"afterBegin",
T([
'<div id="$id$" ',
'style="width:1px;height:1px;overflow:auto;*overflow:hidden;white-space:nowrap;',
'position:absolute;left:0;top:0;">','</div>']).replace({
id:baa
})
);
amh=cz.firstChild;
}
amh.innerHTML=htmlEncode(bG);
return amh.scrollWidth;
}







function calcPos(bz,awb)
{
var bU=0,
dN=0,
cH=0,
da=0;

if(bz&&bz.tagName)
{
var abp=bz,
dD=bz.parentNode,
azR=bz.offsetParent,
aM=bz.ownerDocument,
gl=aM.documentElement,
cz=aM.body;

dN+=bz.offsetLeft;
bU+=bz.offsetTop;
cH=bz.offsetWidth;
da=bz.offsetHeight;

while(azR&&dD&&dD!=gl&&dD!=cz)
{
if(calcPos.aTt()&&abp.style&&getStyle(abp,"position")==="fixed")
{
break;
}

if(azR==dD)
{
dN+=dD.offsetLeft;
bU+=dD.offsetTop;
azR=dD.offsetParent;
}

dN-=dD.scrollLeft;
bU-=dD.scrollTop;
abp=dD;
dD=dD.parentNode;

}

if(calcPos.aTt()&&abp.style&&getStyle(abp,"position")==="fixed")
{
dN+=bodyScroll(aM,'scrollLeft');
bU+=bodyScroll(aM,'scrollTop');
}
}

return awb=="json"
?{top:bU,bottom:bU+da,left:dN,
right:dN+cH,width:cH,height:da}
:[bU,dN+cH,bU+da,dN,cH,da];
}

calcPos.aTt=function()
{

var cbH,
ae=this;
if(ae.bcu==cbH)
{
var cE=document.createElement("div");
cE.style.cssText="'position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;";
cE.innerHTML="<div style='position:fixed;top:20px;'></div>";
document.body.appendChild(cE);
ae.bcu=!!{20:1,15:1}[cE.firstChild.offsetTop];
}
return ae.bcu;
};







function calcPosFrame(bz,ao)
{
ao=ao||window;
var mw=calcPos(bz),
_oTop=getTop();
while(ao.frameElement&&ao!=_oTop)
{
var eB=calcPos(ao.frameElement);
for(var i=0;i<4;i++)
{

mw[i]+=eB[i&1?3:0]-bodyScroll(ao,i&1?"scrollLeft":"scrollTop");

}
ao=ao.parent;
}
return mw;
}










function calcAdjPos(kh,qL,mB,ao,ek)
{
var apR=bodyScroll(ao,'clientHeight'),
aTz=bodyScroll(ao,'clientWidth'),
WQ=bodyScroll(ao,'scrollTop'),
axP=bodyScroll(ao,'scrollLeft'),
agZ=WQ+apR,
aQN=axP+aTz,
aE=[0,0,0,0];
if(ek<2)
{

var jh=axP-kh[1];
if(ek==0&&kh[3]<qL
||ek==1&&aQN-kh[1]>qL)
{

aE[1]=(aE[3]=kh[1])+qL;
}
else
{

aE[3]=(aE[1]=kh[3])-qL;
}
if(kh[0]+mB>agZ)
{


aE[0]=(aE[2]=(kh[2]-mB<WQ?agZ:kh[2]))-mB;
}
else
{

aE[2]=(aE[0]=kh[0])+mB;
}
}
else
{

if(ek==2&&kh[0]-WQ<mB
||ek==3&&agZ>kh[2]+mB)
{

aE[2]=(aE[0]=kh[2])+mB;
}
else
{

aE[0]=(aE[2]=kh[0])-mB;
}
aE[1]=kh[1];
aE[3]=kh[3];
}
return aE;
}







function bodyScroll(dJ,av,ce)
{
var aM=(dJ||window).document||dJ,
cz=aM.body,
ta=aM.documentElement;

if(typeof(ce)=="number")
{
cz[av]=ta[av]=ce;
}
else
{
if(av=="scrollTop"&&typeof dJ.pageYOffset!="undefined")
{
return dJ.pageYOffset;
}
else
{
return ta[av]||cz[av];
}
}
}








function htmlDecode(bG)
{
return bG&&bG.replace?(bG.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">")
.replace(/&quot;/gi,"\"").replace(/&#39;/gi,"'").replace(/&amp;/gi,"&")
):bG;
}






function htmlEncode(bG)
{
return bG&&bG.replace?(bG.replace(/&/g,"&amp;").replace(/\"/g,"&quot;")
.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\'/g,"&#39;")):bG;
}







function filteScript(bG,caO)
{
return bG
&&bG.replace(/<script ?.*>(.*?)<\/script>/ig,
"<script>$1\n</script>"
).replace(/<script ?.*>([\s\S]*?)<\/script>/ig,caO||"");
}






function textToHtml(ey)
{

return[
'<DIV>',
ey.replace((ey.indexOf("<BR>")>=0)?/<BR>/ig:/\n/g,
"</DIV><DIV>"
),
"</DIV>"
].join("")
.replace(new RegExp("\x0D","g"),"")
.replace(new RegExp("\x20","g"),"&nbsp;")
.replace(new RegExp("(<DIV><\/DIV>)*$","g"),"")
.replace(/<DIV><\/DIV>/g,"<DIV>&nbsp;</DIV>");
}






function textToHtmlForNoIE(ey)
{
return ey.replace(/\n/g,"<br>");
}






function htmlToText(ey)
{
return ey

.replace(/\n/ig,"")

.replace(/(<\/div>)|(<\/p>)|(<br\/?>)|(<\/li>)/ig,"\n");
}






function fixNonBreakSpace(bG)
{
return(bG||"").replace(/\xA0/ig," ");
}









function pasteHTML(adi,akd,bWu,ao)
{
ao=ao||getMainWin();
adi=filteScript(adi);
var _oContainer=(typeof(akd)=="string"?S(akd,ao):akd);
if(!_oContainer||!adi)
{
return false;
}
if(bWu)
{
_oContainer.innerHTML=adi;
}
else
{
insertHTML(_oContainer,"afterBegin",adi);
}
return true;
}







function T(hE,lW)
{
return new T.te(hE,lW);
}









































function TE(hE,lW)
{
var _oTop=getTop();
if(_oTop.QMTmplChecker)
{
var bc=(new _oTop.QMTmplChecker(hE.join?hE:[hE],
lW)).getErrors();
if(bc.length)
{
debug(bc.join("\n"),"code");
}
}
return new T.te(hE,lW,"exp");
}

T.te=function(hE,lW,av)
{
this.wC=hE.join?hE.join(""):hE.toString();
this.rN=lW||"$";
this.Vp=av=="exp"
?this.WW
:this.Wc;
};

T.te.prototype=
{
toString:function()
{
return this.wC;
},

replace:function(gH,ln)
{
return this.Vp(gH,ln);
},

Wc:function(gH,Vo)
{
var ae=this,
oy=ae.rN,
me=ae.Fs,
wv=ae.VM,
Ez=!me;

if(Ez)
{

me=ae.Fs=ae.wC.split(ae.rN);
wv=ae.VM=ae.Fs.concat();
}

for(var i=1,_nLen=me.length;i<_nLen;i+=2)
{
wv[i]=ae.lg(Ez?(me[i]=me[i].split("."))
:me[i],gH,Vo,oy);
}

return wv.join("");
},

WW:function(gH,ln,Dk)
{
var ae=this,
lv;

if(!ae.Fe)
{
ae.VR();
}

if(typeof ln=="string")
{
var rc=ae.EP[ln];
if(rc)
{
lv=typeof rc!="function"
?ae.EP[ln]=ae.EN(rc)
:rc;
}
}
else
{
lv=ae.Fe;
}

try
{
return lv&&lv(gH,ae.Qo,
ae.lg,ae.rN,htmlEncode,Dk||ln)||"";
}
catch(bc)
{
return bc.message;
}
},




VR:function()
{
var ae=this,
hD=0,
fS=[],
wr=[],
wo=[],
Wv=ae.EP=[],
oy=ae.rN,
iP=new RegExp(["","(.*?)",""].join(regFilter(oy)),"g"),
ov="_afG('$1'.split('.'),_oD,_aoD,_aoR)",
ug=ae.Qo=ae.wC.split(["","@",""].join(oy)),
dH;

for(var i=0,_nLen=ug.length;i<_nLen;i++)
{
dH=ug[i];

if(i%2==0)
{
fS.push("_oR.push(_aoT[",i,"].replace(_oD,_aoD));");
ug[i]=T(dH,oy);
}
else if(dH=="else")
{
fS.push("}else{");
}
else if(dH=="endsec")
{
if(wo.length)
{
var aw=wo.pop();
Wv[aw[0]]=fS.slice(aw[1]);
}
}
else if(dH=="endfor")
{
wr.length&&fS.push(
"try{delete _oD._parent_;delete _oD._idx_;}catch(e){}}_oD=_oS",wr.pop(),";");
}
else if(dH=="endif")
{
fS.push("}");
}
else if(dH.indexOf("else if(")==0)
{
fS.push("}",dH.replace(iP,ov),"{");
}
else if(dH.indexOf("if(")==0)
{
fS.push(dH.replace(iP,ov),"{");
}
else if(dH.indexOf("for(")==0)
{
wr.push(++hD);
fS.push(
"var _sI",hD,",_oD",hD,",_oS",hD,"=_oD;",
dH.replace(iP,
["_sI",hD," in (_oD",hD,"=",ov,")"].join("")),
"{",
"_oD=_oD",hD,"[_sI",hD,"];",
"if(!_oD){continue;}",
"try{_oD._parent_=_oS",hD,";",
"_oD._idx_=_sI",hD,";}catch(e){}"
);
}
else if(dH.indexOf("sec ")==0)
{
wo.push([dH.split(" ").pop(),fS.length]);
}
else if(dH.indexOf("eval ")==0)
{
fS.push("_oR.push(",dH.substr(5).replace(iP,ov),");");
}
else if(dH.indexOf("html(")==0)
{
fS.push("_oR.push(_afE(",dH.substr(5).replace(iP,ov),");");
}
}

ae.Fe=ae.EN(fS);

return fS;
},

EN:function(Vr)
{
try
{
return eval(
[
'([function(_aoD,_aoT,_afG,_aoR, _afE, A){var _oR=[],_oD=_aoD;',
Vr.join(""),
'return _oR.join("");}])'
].join("")
)[0];
}
catch(eM)
{
return function(){return"compile err!"};
}
},

lg:function(oO,gH,BW,sN)
{
var _nLen=oO.length,
bm,
fI;

if(_nLen>1)
{
try
{
fI=gH;
for(var i=0;i<_nLen;i++)
{
bm=oO[i];
if(bm=="_root_")
{
fI=BW;
}
else
{
fI=fI[bm];
}
}
}
catch(bc)
{
fI="";
}
}
else
{
fI={
"_var_":sN,
"_this_":gH
}[bm=oO[0]]||gH[bm];
}

return fI;
}
};










var addEvent=(function()
{








function Iz(eG,av,WX,tl)
{
if(eG&&WX)
{
if(eG.addEventListener)
{
eG[tl?"removeEventListener":"addEventListener"](
av,WX,false
);
}
else if(eG.attachEvent)
{
eG[tl?"detachEvent":"attachEvent"]("on"+av,
WX
);
}
else
{
eG["on"+av]=tl?null:WX;
}
}

return eG;
}

return function(eG,av,aPH,tl)
{
if(eG&&(eG.join||eG[aDV]))
{
E(eG,function(_aoDom)
{
Iz(_aoDom,av,aPH,tl);
}
);
}
else
{
Iz(eG,av,aPH,tl);
}

return eG;
};
}
)();








function addEvents(eG,iA,tl)
{
E(iA,function(pe,av)
{
addEvent(eG,av,pe,tl);
}
);
return eG;
}








function removeEvent(eG,av,WX)
{
return addEvent(eG,av,WX,true);
}







function removeEvents(eG,iA)
{
return addEvents(eG,iA,true);
}






function preventDefault(_aoEvent)
{
if(_aoEvent)
{
if(_aoEvent.preventDefault)
{
_aoEvent.preventDefault();
}
else
{
_aoEvent.returnValue=false;
}
}
return _aoEvent;
}






function stopPropagation(_aoEvent)
{
if(_aoEvent)
{
if(_aoEvent.stopPropagation)
{
_aoEvent.stopPropagation();
}
else
{
_aoEvent.cancelBubble=true;
}
}
return _aoEvent;
}






function getEventTarget(_aoEvent)
{
return _aoEvent&&(_aoEvent.srcElement||_aoEvent.target);
}











function getUserTarget(_aoDom,_aoEvent,dS)
{
var aF=getEventTarget(_aoEvent);
while(aF&&isObjContainTarget(_aoDom,aF))
{
if(attr(aF,dS))
{
return aF;
}
aF=aF.parentNode;
}
}











function fireMouseEvent(bz,arD,_aoEvent)
{
if(bz)
{
_aoEvent=_aoEvent||{};
if(bz.dispatchEvent)
{

var aM=bz.ownerDocument,
az=aM.defaultView,
bK=aM.createEvent("MouseEvents");
bK.initMouseEvent(arD,true,true,az,0,0,0,0,0,!!_aoEvent.ctrlKey,!!_aoEvent.altKey,!!_aoEvent.shiftKey,!!_aoEvent.metaKey,0,null);
bz.dispatchEvent(bK);
}
else
{


if(bz.tagName=="INPUT"&&bz.getAttribute("type")=="submit"&&arD=="click")
{
bz.click();
}
else
{
var bK=bz.ownerDocument.createEventObject();
for(var aZ=["ctrlKey","altKey","shiftKey","metaKey"],i=aZ.length-1;i>=0;i--)
{
bK[aZ[i]]=_aoEvent[aZ[i]];
}
bz.fireEvent("on"+arD,bK);
}
}
}
return bz;
}











function loadJsFile(jQ,aDt,ez,VZ,qS,dKl)
{
var aM=ez||document,
bZl=typeof VZ=="function",
dDW,eK,
Av=getTop().loadJsFile,
_sFile=getRes(jQ),
jS=Av.jS||(Av.jS={});

if(aDt)
{
for(var adN=GelTags("script",aM),
i=adN.length-1;i>=0;i--)
{
if(adN[i].src.indexOf(_sFile)!=-1)
{
if(bZl)
{
var bm=adN[i].getAttribute("_key_");
if(jS[bm]===true)
{
callBack.call(adN[i],VZ);
}
else
{
jS[bm].push(VZ);
}
}
return adN[i];
}
}
}

eK=aM.createElement("script");
E(qS,function(nz,bn)
{
eK.setAttribute(bn,nz);
}
);

var bm=unikey();
eK.setAttribute("_key_",bm);
jS[bm]=[];

function aTl()
{
var ae=this,bm=ae.getAttribute("_key_");
callBack.call(ae,VZ);
E(jS[bm],function(dT){dT()});
jS[bm]=true;

if(dKl)
{
removeSelf(eK);
}
}

(GelTags("head",aM)[0]||aM.documentElement)
.appendChild(extend(eK,

{
onload:aTl,
onreadystatechange:function()
{
var ae=this;
({loaded:true,complete:true}[ae.readyState])&&aTl.call(this);
}
},
{
type:"text/javascript",
charset:qS&&qS.charset||"gb2312",
src:_sFile
}
)
);

return eK;
}






function loadJsFileToTop()
{

if(arguments.length==2)
{
var ayp=arguments[0],
qI=arguments[1];
}
else
{
var ayp="",
qI=arguments[0];
}
var bRy=window.loadJsFile;


function buH(jQ)
{
if(jQ)
{

bRy(ayp+jQ,true,getTop().document);
}
}
E(qI,buH);
}









function loadCssFile(jQ,aDt,ez)
{
var aM=ez||document,
_sFile=getRes(jQ);

if(aDt)
{
for(var biM=GelTags("link",aM),
i=biM.length-1;i>=0;i--)
{
if(biM[i].href.indexOf(_sFile)!=-1)
{
return;
}
}
}

var kQ=aM.createElement("link"),
aEZ=GelTags("link",aM);

kQ.type="text/css";
kQ.rel="stylesheet";
kQ.href=_sFile;

if(aEZ.length>0)
{
var aYV=aEZ[aEZ.length-1];
aYV.parentNode.insertBefore(kQ,
aYV.nextSibling);
}
else
{
(GelTags("head",aM)[0]||aM.documentElement).appendChild(kQ);
}

return kQ;
}








function replaceCssFile(Er,jQ,ez)
{
if(Er)
{
E(GelTags("link",ez||document),function(aFd)
{
if(aFd&&aFd.href.indexOf(Er)!=-1)
{
removeSelf(aFd);
}
});
}

return loadCssFile(jQ,false,ez);
}









function QMAjax(bj,jZ,pz,fP)
{
var ae=this,
_oTop=getTop(),
kA=fP,
dE;

function bqI()
{
ae.onComplete(kA);
}

function bmG(cX)
{
ae.onError(kA,cX);
}

function buS(bww)
{
if(!dE)
{
dE=setTimeout(
function()
{
ae.abort();
},
bww
);
}
}

function UU(cX)
{
if(dE)
{
clearTimeout(dE);
dE=null;
if(cX!="ok")
{
bmG(cX);
}
return true;
}
return false;
}



this.method=jZ||"POST";
this.url=bj;
this.async=true;
this.content="";
this.timeout=pz;


this.onComplete=function()
{
};
this.onError=function()
{
};

if(!kA)
{
try
{
kA=new XMLHttpRequest;
}
catch(bc)
{
try
{
kA=new ActiveXObject("MSXML2.XMLHTTP");
}
catch(bc)
{
try
{
kA=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(bc)
{
}
}
}
}



if(!kA)
{
return false;
}





this.abort=function()
{
UU("abort");
kA.abort();
};






this.send=function(bwm)
{
if(!this.method||!this.url||!this.async)
{
return false;
}

typeof this.url=="object"&&(this.url=this.url.replace({}));

var fe=this.method.toUpperCase(),
jD=getTop().getSid&&getTop().getSid();
this.abort();

kA.open(fe,

this.url+(jD&&fe=="POST"&&((this.url.split("?")[1]||"")+"&").indexOf("&sid=")==-1
?(this.url.indexOf("?")==-1?"?sid=":"&sid=")+jD:""),
this.async
);

if(fe=="POST")
{
kA.setRequestHeader("Content-Type",document.charset);
kA.setRequestHeader("Content-length",this.content.length);
kA.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded"
);
}

_oTop.E(this.headers,function(bJ,bn)
{
kA.setRequestHeader(bn,bJ);
}
);

kA.onreadystatechange=function()
{
try
{
if(kA.readyState==4)
{
if(kA.status==200)
{
if(UU("ok"))
{
bqI();
}
}
else
{
UU(kA.status);
}
}
}
catch(dq)
{
UU(dq.message);
}
}



buS(this.timeout||15000);

try
{
if(fe=="POST")
{
kA.send(bwm||this.content);
}
else
{

kA.send(null);
}
}
catch(bc)
{
UU(bc.message);
}

return true;
}
};













QMAjax.send=function(bj,aj,bnJ)
{
var _oTop=getTop(),
eZ=bnJ||new QMAjax,
aR=aj||{};
eZ.url=bj;

_oTop.E("method,timeout,content,headers".split(","),function(bn)
{
if(aR[bn])
{
eZ[bn]=aR[bn];
}
}
);

eZ.onComplete=function(fP)
{
_oTop.callBack.call(fP,aj.onload,[true,_oTop.trim2(fP.responseText||""),fP]);

};

eZ.onError=function(fP,cX)
{
_oTop.callBack.call(fP,aj.onload,[false,cX,fP]);
};

eZ.send();
}

function includeAjax(ao)
{


var iw=[];
iw.push(QMAjax.toString());
iw.push(["var QMAjaxSend =",QMAjax.send.toString()].join(""));
globalEval(iw.join(""),ao);

}

var QMAjaxRequest=QMAjax;







function getErrMsg(fP,aQr)
{
var ajx="_AjaxErrorHTML_";
var AE=S(ajx);
if(!AE)
{
AE=document.createElement("div");
AE.id=ajx;
AE.style.display="none";
document.body.appendChild(AE);
}
AE.innerHTML=filteScript(fP.status==200?fP.responseText:"");
var RY=S(aQr);
return RY&&(RY.innerText||RY.textContent)||"";
}





function getHttpProcesser()
{
var _oTop=getTop(),
amf=_oTop.gCurHttpProcesserId||0;

_oTop.gCurHttpProcesserId=(amf+1)%30;

try
{
if(_oTop.gHttpProcesserContainer[amf]!=null)
{
delete _oTop.gHttpProcesserContainer[amf];
}
}
catch(bc)
{
_oTop.gHttpProcesserContainer={};
}

var bel=_oTop.gHttpProcesserContainer[amf]=new _oTop.Image;
bel.onload=function()
{
return false;
};

return bel;
}







function goUrl(aDB,bj,bNW)
{
try
{
var sk=(aDB.contentWindow||aDB).location,
bPG=sk.href.split("#"),
aXh=bj.split("#"),
bUr=aXh[0]==bPG[0],
aT=bUr?aXh[0]:bj;

if(bNW)
{
sk.href=aT;
}
else
{
sk.replace(aT);
}
}
catch(bc)
{
aDB.src=bj;
}
}









function generateFlashCode(aI,aFw,Eu,aX)
{
var aYs=[],
aDe=[],
aoK=[],
dp=aX||{},

ank=T(' $name$=$value$ '),
bcW=T('<param name="$name$" value="$value$" />'),
bQN=gbIsIE?T([
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ',
'$codebase$ ','$attr$ $id$ >',
'$param$',
'<embed $embed$ type="application/x-shockwave-flash" ',
'$pluginspage$ ',' $name$ ></embed>',
'</object>'
]):T([
'<embed $embed$ type="application/x-shockwave-flash" ',
'$pluginspage$ ',' $name$ $id$ ></embed>'
]);

function apY(aD,nz)
{
return{
name:aD,
value:nz
};
}

dp.allowscriptaccess=Eu&&Eu.allowscriptaccess||"always";
dp.quality="high";

for(var Dj in dp)
{
var bX=apY(Dj,dp[Dj]);
aDe.push(bcW.replace(bX));
aoK.push(ank.replace(bX));
}

for(var Dj in Eu)

{
var bX=apY(Dj,Eu[Dj]);
aYs.push(ank.replace(bX));
aoK.push(ank.replace(bX));
}

if(aFw)
{
aDe.push(bcW.replace(apY("movie",aFw)));
aoK.push(ank.replace(apY("src",aFw)));
}

return bQN.replace({
id:aI&&[' id="',aI,'"'].join(""),
name:aI&&[' name="',aI,'"'].join(""),
attr:aYs.join(""),
param:aDe.join(""),
embed:aoK.join(""),
codebase:location.protocol=="https:"
?''
:'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" ',
pluginspage:location.protocol=="https:"
?''
:'pluginspage="http://www.adobe.com/cn/products/flashplayer" '
}
);
}







function getFlash(aI,ao)
{
var az=ao||window,
dD=az[aI]||az.document[aI];
return dD&&(dD.length?dD[dD.length-1]:dD);
}

















function zoomFuncCreater(aj)
{














return function(qL,mB,bKG,bSV)
{
var aBg=bKG||aj.limitWidth||1,
aDS=bSV||aj.limitHeight||1,
aIO=(qL/aBg)||1,
aHB=(mB/aDS)||1,
uC=[aIO<1?"w":"W",aHB<1?"h":"H"]
.join(""),
Iw=aj[uC]||aj.all,
aE={};

switch(Iw)
{
case"stretch":
aE.width=aBg;
aE.height=aDS;
break;
case"zoomMaxMin":
case"zoomMinMax":
var aUu=qL>mB?0:1;
Iw=["zoomMax","zoomMin"][Iw=="zoomMinMax"
?1-aUu
:aUu];
case"zoomMax":
case"zoomMin":
var afr=Math[Iw=="zoomMax"?"min":"max"](
aHB,aIO
);
aE.width=Math.round(qL/afr);
aE.height=Math.round(mB/afr);
break;
case"none":
default:
aE.width=qL;
aE.height=mB;
break;
}

aE.left=Math.round((aBg-aE.width)/2);
aE.top=Math.round((aDS-aE.height)/2);

return aE;
};
}










function scrollIntoMidView(bz,eW,bRx,
ceS,bWY)
{
if(!bz||!eW)
{
return false;
}


var bgU=eW.tagName.toUpperCase()=="BODY",
aM=eW.ownerDocument,
ta=aM.documentElement;
if(bgU&&ta.clientHeight)
{
eW=ta;
}

var uB=calcPos(bz)[0]-calcPos(eW)[0]-(bgU?eW.scrollTop:0),
Pf=uB,
Zp=bz.offsetHeight,
anL=eW.clientHeight,
aBp=ceS||0;

if(bRx||Pf<0
||Pf+Zp>anL)
{
var aui=0,
nf;

if(anL>Zp+aBp)
{
if(bWY)
{
aui=Pf<0?0
:(anL-Zp-aBp);
}
else
{
aui=(anL-Zp-aBp)/2
}
}

nf=eW.scrollTop=eW.scrollTop+uB-aui;
eW==ta&&(aM.body.scrollTop=nf);
}

return true;
}





function Gel(aI,bz)
{
return(bz||document).getElementById(aI);
}





function objectActive(bz)
{





}




















function inherit(aBw,uh,aFv,azV,bSC)
{
var bdW=callBack(aFv,[uh.prototype]),
bHP=bdW.$_constructor_,
Vc=function()
{
if(arguments[0]!="__inherit__")
{

var aWE=callBack.call(this,bSC,arguments)||{};
if(aWE.bReturn)
{
return aWE.vData;
}
else
{
if(!this.bVO)
{
this.constructor=arguments.callee;
this.bVO=true;
}
uh.apply(this,arguments);
callBack.call(this,bHP,arguments);
}
}
};
extend(Vc.prototype=new uh("__inherit__"),bdW,{toString:function(){return"";}});
return extend(Vc,azV,
{
name:aBw,
superclass:uh
}
);
}







function inheritEx(aBw,uh,aFv,azV)
{
var abO={},
Vc=inherit(aBw,uh,aFv,azV,
function()
{
var aW=typeof(arguments[0]),
bWv=aW=="string"||aW=="undefined";

return{
bReturn:bWv,
vData:Vc.$_call.apply(Vc,arguments)
};
}
);
return extend(
Vc,
{


$_call:function(aI,cbj,ay)
{
if(arguments.length==0)
{
return abO;
}
else
{
var eb=abO[aI];
return arguments.length>1&&eb?
callBack.call(eb,eb[cbj],ay):eb;
}
},

$_add:function(aI,aC)
{
return abO[aI]=aC;
},

get:function(aI)
{
return abO[aI];
},

$_del:function(aI)
{
delete abO[aI];
}
}
);
}


























function cacheByIframe(aDK,cd)
{
var bm="_cAcheBYifRAme_",
cS=cd||{},
az=cS.win||getTop(),
aU=cS.id||unikey("_"),
eQ=[cS.attrs],
_oHeader=[cS.header],
cz=[],
cxX=cS.virtual!==false;


for(var i=0,_nLen=aDK&&aDK.length||0;i<_nLen;i++)
{
for(var Ok=aDK[i],j=2,bNO=Ok.length;j<bNO;j++)
{
switch(Ok[0])
{
case"img":
cz.push('<img src="',Ok[1],Ok[j],'"/>');
break;
case"js":
case"html":
if(gbIsWebKit)
{
cz.push('<img src="',Ok[1],Ok[j],'"/>');
break;
}
if(gbIsIE)
{
_oHeader.push('<script src="',Ok[1],Ok[j],'" ><\/script>');
break;
}
case"css":
_oHeader.push('<link rel="stylesheet" type="text/css" href="',Ok[1],Ok[j],'" />');
}
}
}



!az[bm]&&(az[bm]={});
az[bm][aU+"_h"]=_oHeader.join("");

az[bm][aU+"_b"]=((cS.body||"").toString().indexOf("<body")==-1?
'<body class="domain">'+cz.join("")+'</body>':
cS.body+cz.join(""));

createIframe(az,
(cxX?
["javascript:(function(){document.open();document.domain='",document.domain,"';frameElement['_render_']=1;",
"try{document.write('<head><script>window.onerror=function(){return true};<\/script>'+",
"parent['",bm,"']['",aU,"_h']+'</head>'+parent['",bm,"']['",aU,"_b']);",
"parent['",bm,"']['",aU,"_h']=parent['",bm,"']['",aU,"_b']=null;}catch(e){alert(e.message);}",
"document.close();})()"
]:
[getRes("$base_path$zh_CN/htmledition/domain20ef56a.html"),"#",encodeURIComponent(document.domain),
"&",bm+"&"+encodeURIComponent(aU)+"&"+(cS.destroy!==false?"1":"")
]
).join(""),
extend({},cS,
{
id:aU,
attrs:eQ.join(""),
onload:function(ao)
{
var pF=this;
if(!cxX||pF["_render_"])
{
callBack.call(pF,cS.onload,[ao]);

(cS.destroy!=false||pF.getAttribute("destroy")=="true")
&&az.setTimeout(function(){removeSelf(pF);},100);
}
}
}
)
);
}








function clearCache()
{












arguments.length>0&&getTop().cacheByIframe(arguments,
{
virtual:false,
destroy:false,
onload:function()
{
if(!this.getAttribute("destroy"))
{
this.setAttribute("destroy","true");
this.contentWindow.location.reload(true);
}
}
}
);
}








function preLoad(av,eP,qI,beR)
{
if(window!=getTop())
{
getTop().preLoad.apply(this,arguments);
}
else
{
var ae=arguments.callee,
anu=ae.bTk=(ae.bTk||[]);

if(av&&qI)
{
for(var i=0,_nLen=qI.length;i<_nLen;i++)
{
anu.push([[av,eP,qI[i]]]);
}
}

if(!ae.bhq&&anu.length>0)
{
ae.bhq=true;

function ave()
{
ae.bhq=false;
callBack(beR,[anu.shift()[0][2]]);
setTimeout(function(){ae("","","",beR);},100);
}

cacheByIframe(anu[0],{onload:ave});
}
}
}





function setDblClickNoSel(bz)
{
if(bz)
{
var aHK="__MoUSeDoWnnoSEL__";
function getAtts()
{
return(bz.getAttribute(aHK)||"").toString().split(",");
}
function setAtts(gZ,av)
{
bz.setAttribute(aHK,[gZ,av]);
}
if(getAtts().length==1)
{

setAtts(0,"up");
addEvents(bz,{
mousedown:function(_aoEvent)
{
var gW=now(),
Js=parseInt(getAtts()[0]);
setAtts(gW,"down");

if(gW-Js<500)
{
preventDefault(_aoEvent);
}
},

mouseup:function()
{
setAtts(getAtts()[0],"up");
},
selectstart:function(_aoEvent)
{
if(getAtts().pop()=="up")
{
preventDefault(_aoEvent);
}
}
});
}
}

return bz;
}






































var 
gsMsgNoSubject="\u8BF7\u586B\u5199\u90AE\u4EF6\u4E3B\u9898",
gsMsgNoMail="\u672A\u9009\u4E2D\u4EFB\u4F55\u90AE\u4EF6",
gsMsgSend="\u90AE\u4EF6\u6B63\u5728\u53D1\u9001\u4E2D... ",
gsMsgSave="&nbsp;&nbsp;&nbsp;\u90AE\u4EF6\u6B63\u5728\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1...",
gsMsgSaveOk="\u90AE\u4EF6\u6210\u529F\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1",
gsMsgAutoSave="&nbsp;&nbsp;&nbsp;\u90AE\u4EF6\u6B63\u5728\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1...",
gsMsgAutoSaveOk="\u90AE\u4EF6\u81EA\u52A8\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1",
gsMsgSendErrorSaveOK="\u4FE1\u4EF6\u5DF2\u88AB\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1",
gsMsgSaveErr="\u90AE\u4EF6\u672A\u80FD\u4FDD\u5B58\u5230\u8349\u7A3F\u7BB1",
gsMsgNoSender="\u8BF7\u586B\u5199\u6536\u4EF6\u4EBA\u540E\u518D\u53D1\u9001",
gsMsgNoCardSender="\u8BF7\u586B\u5199\u6536\u4EF6\u4EBA\u540E\u518D\u53D1\u9001",
gsMsgNoCard="\u8BF7\u9009\u4E2D\u8D3A\u5361\u540E\u518D\u53D1\u9001",
gsMsgSettingOk="\u8BBE\u7F6E\u4FDD\u5B58\u6210\u529F",
gsMsgLinkErr="\u7F51\u7EDC\u5E94\u7B54\u5931\u8D25",
gsMsgCheatAlert="\u7CFB\u7EDF\u4F1A\u5C06\u6B64\u90AE\u4EF6\u79FB\u5165\u5230\u201C\u5783\u573E\u90AE\u4EF6\u201D\u4E2D\uFF0C\u5E76\u628A\u90AE\u4EF6\u5185\u5BB9\u63D0\u4EA4\u7ED9\u90AE\u7BB1\u7BA1\u7406\u5458\u3002\n\n\u60A8\u786E\u5B9A\u8981\u4E3E\u62A5\u6B64\u90AE\u4EF6\u5417\uFF1F",
gsMsgSendTimeErr="\u60A8\u8BBE\u7F6E\u7684\u53D1\u9001\u65F6\u95F4\u4E0D\u5B58\u5728",
gsMsgMoveMailSameFldErr="\u4E0D\u80FD\u79FB\u52A8\u5230\u76F8\u540C\u7684\u76EE\u5F55";








function doPageError(_asMsg,bj,Cj)
{
var hI=arguments.callee.caller,
ama=hI&&hI.caller,
brf=ama&&ama.caller,
aMH=(hI||"null").toString(),
aJz=(ama||"").toString(),
aIf=(brf||"").toString(),
agN;

try
{

if(_asMsg.indexOf(" Script ")!=-1)
{
return;
}


log("err:",_asMsg,"-",bj,"-",Cj);

if(_asMsg.indexOf("flashUploader")!=-1)
{
var biT=qmFlash.getFlashVer();
for(var i in biT)
{
_asMsg+="|"+biT[i];
}
}

if(!(bj&&bj.indexOf("/cgi-bin/mail_list?")!=-1&&Cj==2)&&location.getParams)
{
var dp=location.getParams(bj);
bdY=(bj||"").split("?")[0].split("/"),
aUB=encodeURIComponent(
aMH.replace(/[\r\n\t ]/ig,"")
.substr(0,50)
);

if(bdY.length>0)
{
dp.cgi=bdY.pop();
getTop().ossLog("delay","sample",[
"stat=js_run_err&msg=",
_asMsg,
"&line=",
Cj,
"&url=",
T('$cgi$?t=$t$&s=$s$').replace(dp),
"&func=",
aUB,(gbIsIE?"":"_NIE")
].join(""));
}
else
{
agN=aUB;
}
}

getTop().debug([
"error:",
_asMsg,
"<br><b>line</b>:",
Cj,
"<br><b>url</b>:",
bj,
"<br><b>function</b>:",
aMH.substr(0,100),
aJz?"<br><b>parent function</b>:"
+aJz.substr(0,100):"",
aIf?"<br><b>parent parent function</b>:"
+aIf.substr(0,100):""].join(""),"error");
}
catch(bc)
{
agN=bc.message;
}

agN&&log("err:doPageError ",agN,"-",bj,"-",Cj);







return location.host.indexOf("dev.")!=0;
}




var QMFileType={};

QMFileType.data={
doc:"doc",
docx:"doc",

xls:"exl",
xlsx:"exl",

ppt:"ppt",
pptx:"ppt",

pdf:"pdf",

txt:"txt",
log:"txt",
xml:"txt",
js:"txt",
css:"txt",
php:"txt",
asp:"txt",
aspx:"txt",
jsp:"txt",
vbs:"txt",
h:"txt",
cpp:"txt",

eml:"eml",

rar:"rar",
zip:"rar",
"7z":"rar",
arj:"rar",

wav:"mov",
mp3:"mov",
wma:"mov",
mid:"mov",
rmi:"mov",
ra:"mov",
ram:"mov",

mp1:"mov",
mp2:"mov",
mp4:"mov",
rm:"mov",
rmvb:"mov",
avi:"mov",
mov:"mov",
qt:"mov",
mpg:"mov",
mpeg:"mov",
mpeg4:"mov",
dat:"mov",
asf:"mov",
wmv:"mov",
"3gp":"mov",
ac3:"mov",
asf:"mov",
divx:"mov",
mkv:"mov",
ogg:"mov",
pmp:"mov",
ts:"mov",
vob:"mov",
xvid:"mov",

htm:"html",
html:"html",
mht:"html",

swf:"swf",
flv:"swf",

bmp:"bmp",
gif:"gif",
jpg:"jpg",
jpeg:"jpg",
jpe:"jpg",
psd:"psd",
pdd:"psd",
eps:"psd",

tif:"tu",
tiff:"tu",
ico:"tu",
png:"tu",
pic:"tu",
ai:"tu"
};






QMFileType.getFileType=function(aeI)
{
return this.data[(trim(aeI||"")).toLowerCase()]||"qita";
};






QMFileType.getFileTypeForFile=function(gP)
{
return this.getFileType((gP||"").split(".").pop());
};






var QMHistory={
aeb:{




},
afm:{





}
};






QMHistory.getId=function(aI)
{
return aI;
};






QMHistory.getUrl=function(aI)
{
var bI=getTop().QMHistory.afm[QMHistory.getId(aI)];
return bI&&bI.aT;
};





QMHistory.getLastRecordId=function()
{
return getTop().QMHistory.aeb.cbl;
};






QMHistory.tryBackTo=function(aI)
{
try
{
var bX=getTop().QMHistory.aeb,
amz=QMHistory.getId(aI),
Vn=getTop().QMHistory.afm[amz],
aUk=Vn&&Vn.aT,
beY=Vn
&&Vn.bZp>=getTop().history.length,
bfc=Vn&&bX.bOh==aUk,
bfe=Vn&&!bX.bWf;

function bTm()
{
var aT=aUk.split("#")[0];

if(getTop().location.getParams
&&getTop().location.getParams(aT)["folderid"]==4)
{
return goUrlMainFrm(aT);
}


if(gbIsIE&&gnIEVer==6)
{
return getTop().history.go(aT);
}
getTop().history.back();
};

if((gbIsIE&&(beY||bfc)&&bfe)
||(!gbIsWebKit&&beY&&bfc&&bfe))
{

bTm();
return true;
}
}
catch(bc)
{

}

return false;
};





QMHistory.recordCurrentUrl=function(ao)
{
var aT=ao.location.href,
NF=getTop().QMHistory.afm,
bX=getTop().QMHistory.aeb;

var bMV=bX.bOh=bX.bHA,
IF=bX.bHA=aT;

var agb,II;


for(var i in NF)
{
if(NF[i].aT==bMV)
{
agb=i;
}
if(NF[i].aT==IF)
{
II=i;
}
}


if(agb&&II)
{
delete NF[agb];
}


if(aT.indexOf("/mail_list")!=-1)
{
this.aAV("mail_list",aT);
}

if(aT.indexOf("t=readmail")!=-1)
{
this.aAV("readmail",aT);
}

if(aT.indexOf("/today")!=-1)
{
this.aAV("today",aT);
}
};





QMHistory.recordActionFrameChange=function(cX)
{
getTop().QMHistory.aeb.bWf=cX!="clear";
};






QMHistory.aAV=function(aI,bj)
{
var _oTop=getTop(),
amz=QMHistory.getId(aI),
NF=_oTop.QMHistory.afm,
bI=NF[amz];

if(!bI)
{
bI=NF[amz]=new _oTop.Object;
}

bI.bZp=history.length+1;
bI.aT=bj;

_oTop.QMHistory.aeb.cbl=aI;
};












function QMCache(aj)
{
var Js=this.bLP=aj.timeStamp||1;
var FO=this.aaZ=aj.appName;

if(!Js||!FO)
{
throw{
message:"QMCache construct : config error!"
};
}

var aqc=getTop().QMCache.UD;
if(!aqc)
{
aqc=getTop().QMCache.UD={};
}

var JJ=aqc[FO];
if(!JJ)
{
JJ=aqc[FO]={
aGf:"0",
qF:{}
};
}

if(this.bhG(JJ.aGf,Js)==1)
{
JJ.aGf=Js;
}
};





QMCache.prototype.isHistoryTimeStamp=function()
{
return this.bhG(
getTop().QMCache.UD[this.aaZ].aGf,
this.bLP
)!=0;
};






QMCache.prototype.setData=function(bn,bJ)
{
getTop().QMCache.UD[this.aaZ][bn]=bJ;
};

QMCache.prototype.getAll=function(bn)
{
return getTop().QMCache.UD[this.aaZ];
}






QMCache.prototype.getData=function(bn)
{
return getTop().QMCache.UD[this.aaZ][bn];
};





QMCache.prototype.delData=function(bn)
{
delete getTop().QMCache.UD[this.aaZ][bn];
};







QMCache.prototype.bhG=function(bgf,bge)
{
if(bgf==bge)
{
return 0;
}
return bgf>bge?-1:1;
};










var QMMailCache=
{
LF:now()
};







QMMailCache.newCache=function(uJ,aqy)
{
var Pv=false,
_oTop=getTop();

if(!_oTop.gMailListStamp||_oTop.gMailListStamp<aqy)
{
_oTop.gMailListStamp=aqy;
if(!_oTop.goMailListMap)
{
_oTop.goMailListMap=new _oTop.Object;
}
Pv=true;
}
else if(_oTop.gnExpireTimeStamp>=aqy)
{







reloadFrm(uJ);
}

return uJ["isNewQMMailCache"+this.LF]=Pv;
};




QMMailCache.setExpire=function()
{
getTop().gnExpireTimeStamp=getTop().gMailListStamp;
};













QMMailCache.addData=function(aP,aX)
{
if(!aP||!getTop().goMailListMap)
{
return;
}

if(!this.hasData(aP))
{
getTop().goMailListMap[aP]={
oTagIds:{},
bUnread:null,
star:null,
reply:null
};
}

if(!aX)
{
return;
}

var gC=getTop().goMailListMap[aP];
for(var i in aX)
{
switch(i)
{
case"removeTagId":
gC.oTagIds[aX[i]]=0;
break;
case"addTagId":
gC.oTagIds[aX[i]]=1;
break;
default:
if(typeof aX[i]!="undefined")
{
gC[i]=aX[i];
}
break;
}
}
};





QMMailCache.delData=function(aP)
{
if(getTop().goMailListMap)
{
delete getTop().goMailListMap[aP];
}
};






QMMailCache.hasData=function(aP)
{
return getTop().goMailListMap&&getTop().goMailListMap[aP]!=null;
};






QMMailCache.getData=function(aP)
{
return getTop().goMailListMap&&getTop().goMailListMap[aP];
};







QMMailCache.addVar=function(aaV,ce)
{
return getMainWin()[aaV]=this.getVar(aaV,0)+ce;
};







QMMailCache.getVar=function(aaV,buu)
{
return getMainWin()[aaV]||buu;
};






QMMailCache.isRefresh=function(uJ)
{
return uJ["isNewQMMailCache"+this.LF];
};










function rdVer(UZ,SR,aCw)
{

var aFa,rG,NV,aEt,
bI=new QMCache({appName:"readmail"});

if(SR==-1)
{
return bI.delData(UZ);
}

aFa=bI.getData("on");
if(UZ=="on")
{
return SR==0?(aFa||0):(bI.setData("on",SR));
}

if(!aFa||!UZ)
{
return 0;
}

aEt=UZ=="BaseVer";

NV=bI.getData("BaseVer");
if(!NV||(aEt&&SR==1))
{

NV=NV||(rdVer("on",0)+(+Math.random().toFixed(2)));
NV+=10;
bI.setData("BaseVer",NV);
}

if(aEt)
{
return NV;
}

rG=(bI.getData(UZ)||0);
var bhL=(!rG||SR==1);

if(bhL||aCw)
{
if(bhL)
{
rG+=10000;
}
if(aCw)
{
rG=Math.floor(rG/10000)*10000+parseInt(aCw,10)%10000;
}
bI.setData(UZ,rG);
}
return rG;
}

rdVer.batch=function(av)
{
var bI=new QMCache({appName:"readmail"}),
iP=new RegExp("^"+av),
gC=bI.getAll();

E(gC,function(MB,aP)
{
if(iP.test(aP))
{
rdVer(aP,1);
}
}
);
}






rdVer.check=function(ao,aP,ajm)
{
if(ao)
{
var jw=ao.location,
aP=aP||jw.getParams()["mailid"],
ajm=ajm||jw.getParams()["ver"]||0,
bbi=rdVer(aP,0);

if(bbi>ajm)
{
goUrl(ao,cookQueryString(jw.href,{ver:bbi}),true);
return true;
}
else
{
return false;
}
}
}






rdVer.log=function(aP,Vh)
{
var aGj=new QMCache({appName:"preload"}),
Nu=new Date().getTime(),
eV=aGj.getData(aP),
asK=eV&&(Nu-eV)<rdVer.maxage(aP)*1000;

switch(Vh)
{
case"pre":
if(!asK)
{
aGj.setData(aP,Nu);
ossLog("delay","all","stat=rdcache&type=281&locval=,rdcache,preload,1");
}
break;
case"hit":
if(asK)
{
ossLog("delay","all","stat=rdcache&type=291&locval=,rdcache,hit,1");
}
if(eV)
{
aGj.delData(aP);
}
break;
}
return asK;
}

rdVer.isPre=function(Mh)
{

return!(Mh>2&&Mh<7||Mh==9||Mh==11);
}


rdVer.preRD=function(Vl,WU)
{
var atv=function()
{
preLoad("html","/cgi-bin/readmail?",Vl,function(jQ)
{
rdVer.log(location.getParams(jQ)["mailid"],"pre");
}
);
}
if(Vl&&Vl.length>0)
{
WU=WU||40;

Vl=Vl.slice(0,rdVer("on",0)>1?2:1);

if(Vl.length>0)
{
if(WU)
{
setTimeout(atv,WU);
}
else
{
atv();
}
}
}
}

rdVer.maxage=function(aP)
{
if(!aP)
{
return 0;
}
return(aP[0]=="@"||aP[0]=="C"?10:60)*60;
}










rdVer.url=function(aP,nc,bUP,ek,bMc,acC,
aDD,azG,beA)
{
var bit='/cgi-bin/$cgi$?folderid=$folderid$$s$&t=$t$&mailid=$mailid$$cache$&sid=$sid$',
aBq,
KE,Jc,aT,vM="readmail";

if(aDD)
{
KE="readmail&s=draft";
}
else if(ek===0)
{
KE=azG==100?"compose_card&s=draft"
:"compose&s=draft";
}
else if(nc=="9")
{
bit=[location.protocol,location.protocol=="https:"?"//ws.mail.qq.com":"//msgopt.mail.qq.com",bit].join("");
KE="sms_list_v2";
vM="readtemplate";
}
else if(nc=="11"||/^(LP|ZP)/.test(aP))
{
vM="bottle_panel";
KE="bottle";
}
else
{
switch(aP.charAt(0))
{
case'C':
KE="readmail_conversation";
break;
case'@':
KE="readmail_group";
break;
default:
KE="readmail";
break;
}
aBq=true;
}

if(bMc)
{
Jc=["&newwin=true","&compose_new=compose"][ek?0:1];
}
else
{
Jc=["","&s=from_unread_list","&s=from_star_list"][
acC!=1&&acC!=2?0:acC];
}

var rG=aBq?rdVer(aP,0,bUP):0;

if(!rG&&beA)
{
return"";
}

aT=T(bit).replace(
{
cgi:vM,
mailid:aP,
folderid:nc,
t:KE,
s:Jc,
sid:getSid(),
cache:rG?T("&mode=pre&maxage=$maxage$&base=$base$&ver=$ver$").replace(
{
maxage:rdVer.maxage(aP),
base:rdVer("BaseVer",0),
ver:rG
}
):""
}
);

return beA?aT.split("?")[1]:aT;
}









function setGlobalVarValue(bn,dM,bMJ)
{
var _oTop=getTop();

if(!_oTop.goDataBase)
{
_oTop.goDataBase=new _oTop.Object;
}

if(bn&&!bMJ)
{
_oTop.goDataBase[bn]=dM;
}

return dM;
}






function getGlobalVarValue(bn)
{
return getTop().goDataBase&&getTop().goDataBase[bn];
}






function hideWindowsElement(hB,ao)
{
ao=ao||getMainWin();
if(!gbIsIE||gnIEVer>6||(ao.gbIsHasHideElements||false)!=(hB||false))
{
return;
}

getTop().setGlobalVarValue("WINDOWS_ELEMENT_NOT_DISPLAY",hB?"":"true");

ao.gbIsHasHideElements=!hB;

var cz=ao.document.body;

E(ao.QMReadMail?["select","object","embed"]:["select"],
function(bSr)
{
E(GelTags(bSr,cz),
function(bz)
{
if(hB)
{
bz.style.visibility=
bz.getAttribute("savevisibility");
}
else
{
bz.setAttribute("savevisibility",
getStyle(bz,"visibility"));
bz.style.visibility="hidden";
}
}
);
}
);
}






function controlWindowsElement()
{
var bWH=getTop().getGlobalVarValue("WINDOWS_ELEMENT_NOT_DISPLAY");
if(bWH=="true")
{
hideWindowsElement(false);
}
}





function setKeepAlive(ao)
{
if(getTop().gKeepAliveNum==null)
{
getTop().gKeepAliveNum=0;
}

if(ao==null||ao.gbIsSetKeepAlive==true)
{
return;
}

ao.gbIsSetKeepAlive=true;
getTop().gKeepAliveNum++;

if(getTop().gKeepAliveTimer==null)
{

getTop().gKeepAliveTimer=getTop().setInterval(
function()
{
getTop().runUrlWithSid("/cgi-bin/readtemplate?t=keep_alive");
},
15*60*1000
);
}
addEvent(
ao,
"unload",
function()
{
ao.gbIsSetKeepAlive=false;
getTop().gKeepAliveNum--;
if(getTop().gKeepAliveNum==0)
{
getTop().clearInterval(getTop().gKeepAliveTimer);
getTop().gKeepAliveTimer=null;
}
}
);
}







function encodeNick(sX)
{
return sX&&sX.replace(/\\/g,"\\\\").replace(/\"/ig,"\\\"").replace(/\'/ig,"\\\'")||"";
}






function decodeNick(sX)
{
return sX&&sX.replace(/\\\"/ig,"\"").replace(/\\\\/ig,"\\")||"";
}






function rollback(ek)
{
var akn=getGlobalVarValue('DEF_ROLLBACK_ACTION');
if(akn&&akn.rbkey)
{
confirmBox({
title:"\u64A4\u9500\u786E\u8BA4",
mode:"prompt",

height:135,
msg:T([
'\u64A4\u9500\u6700\u8FD1\u4E00\u6B21$msg$\u5417\uFF1F',
]).replace(akn),
onreturn:function(aY)
{
if(aY)
{
QMAjax.send("/cgi-bin/mail_mgr",
{
method:"POST",
content:["sid=",getSid(),"&mailaction=mail_revert&t=mail_mgr2&timekey=",akn.rbkey,"&logtype=",ek].join(''),
onload:function(aY,bN)
{
if(aY&&bN.indexOf("mail_revert successful")>=0)
{
var yJ=getMainWin().location.getParams()["t"];

if(yJ=="mail_list"||yJ=="mail_list_group"||(!yJ&&getMainWin().location.href.indexOf("/cgi-bin/mail_list?")>-1))
{
reloadFrmLeftMain(true,true);
}
else if(yJ=="folderlist_setting")
{
goUrlMainFrm(getMainWin().location.href.replace(/\#.+/,"").replace(/&s=.+?(&|$)/,"&")+"&s="+getMainWin().getType());
reloadFrmLeftMain(true,false);
}
else
{
reloadFrmLeftMain(true,false);
}

setGlobalVarValue('DEF_ROLLBACK_ACTION',null);
showInfo("\u6210\u529F\u64A4\u9500\u6700\u8FD1\u4E00\u6B21"+akn.msg);
}
else
{
var bc=globalEval(bN);
showInfo(bc&&bc.errmsg||("\u64A4\u9500\u6700\u8FD1\u4E00\u6B21"+akn.msg+"\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"));
}
}
});
}
}
});
}
}


var QMPageInit={
biq:function(ao)
{
var _oTop=getTop();
if(ao==_oTop)
{
var hI=new(_oTop.Function)(
"var _oLogs = arguments.callee.logs;_oLogs.length > 500 && _oLogs.shift();"+
"_oLogs.push([+new Date, [].slice.apply(arguments).join('')].join(' '));");
hI.logs=new(_oTop.Array);
return hI;
}
else
{
return _oTop.log||(_oTop.log=this.biq(_oTop));
}
},

caR:function(ceu)
{
return function()
{
try
{
var aBy=arguments.length,
aCa=arguments[aBy-1],
bdL=aCa>100000;
if(typeof(aCa)=="number"
&&(bdL&&aCa!=getTop().g_uin))
{
return;
}
}
catch(e)
{

return;
}

if(getTop().Console)
{
if(aBy==0||(aBy==1&&bdL))
{
if(location.host=="dev.mail.qq.com")
{
debugger;
}
}
else
{
try
{
var _oConsole=getTop().Console[ceu];
_oConsole.add.apply(_oConsole,arguments);

}
catch(bc)
{
}
}
}
}
},

bKi:function(ao)
{
return function(aD,bJz,cX,bHH,ew)
{
if(getTop().QMTimeTracer&&(!ew||ew==getTop().g_uin))
{
getTop().QMTimeTracer.getTracer().trace(aD,bJz,
ao,cX,bHH
);
}
}
},

bGZ:function(ao)
{
var sk=ao.location;
sk.beZ=false;
sk.params={};
sk.getParams=function(bj)
{
if(!bj&&this.beZ)
{
return this.params;
}

var dp={},
aPi=bj
?bj.substr(bj.indexOf("?")+1).split("#")[0]
:this.search.substr(1);

if(aPi)
{
E(aPi.split("&"),function(oI)
{
var bW=oI.split("=");
dp[bW.shift()]=unescape(bW.join("="));
}
);
}

if(!bj)
{
this.params=dp;
this.beZ=true;
}

return dp;
};

var fQ=sk.href,
_oTop=getTop();

if(ao==_oTop
&&getSid()
&&fQ.indexOf("/cgi-bin/")>-1
&&fQ.indexOf("/frame_html?")==-1
&&fQ.indexOf("/log")==-1
&&(fQ.indexOf("/ftnExs_")==-1||fQ.indexOf("/ftnExs_files")>-1)
&&!ao.gbIsNoCheck
&&sk.getParams()["nocheckframe"]!="true")
{
if(fQ.indexOf("/cgi-bin/bizmail")==-1)
{

goNewWin(sk,true,!ao.gbSupportNW);
}
else
{
goNewWin(sk,true,false,{frametmpl:"dm_frame",frametmplparam:"&dmtype=bizmail"});
}
}

else if(ao!=_oTop&&_oTop.bnewwin&&ao==getMainWin())
{
if(!ao.gbSupportNW)
{
goNewWin(sk,true,true);
}
else if(sk.getParams()["newwin"]!="true")
{
ao.location.replace(fQ+"&newwin=true");
}
}
},

bQM:function(_aoEvent,bRQ)
{
var dR=_aoEvent.srcElement||_aoEvent.target,
aiz=_aoEvent.ctrlKey,
ebb=_aoEvent.altKey,
xP=_aoEvent.shiftKey,
djz=_aoEvent.metaKey,
dQ=_aoEvent.keyCode,
Yi=dR.type=="text"
||dR.tagName=="TEXTAREA",
cdN=bRQ
&&(dR.tagName=="INPUT"&&dR.type!="button"),
ccq=dR.tagName=="BUTTON"||dR.type=="button";

switch(dQ)
{

case 8:

if(!Yi&&goBackHistory())
{
preventDefault(_aoEvent);
}
break;

case 13:


if(!ccq&&((!Yi&&QMReadedItem.read(dR))||cdN))
{
preventDefault(_aoEvent);
}
break;

case 37:

case 39:

if(aiz)
{
goPrevOrNextMail(dQ==39);
preventDefault(_aoEvent);
}
break;

case 38:

case 40:

case 188:

case 190:

if(!Yi)
{
var acv=dQ==38||dQ==188;
if(QMReadedItem.move(!acv))
{
preventDefault(_aoEvent);
}
}
break;

case 46:


if(!Yi)
{
var aYh=S(
xP?"quick_completelydel":"quick_del",
getMainWin()
),
aYj=xP?S("quick_del",getMainWin()):null,
aYk=S("del",getMainWin());
if(isShow(aYh)||isShow(aYj)||isShow(aYk))
{
preventDefault(_aoEvent);
fireMouseEvent((aYh||aYj||aYk),"click");
}
}
break;

case 88:

if(!Yi&&QMReadedItem.check(xP))
{
preventDefault(_aoEvent);
}
break;
case 90:
var Cn=dR.tagName.toUpperCase();
if(aiz&&!(Cn=="INPUT"&&dR.type.toLowerCase()!="button"||Cn=="TEXTAREA"))
{
rollback(1);
}
break;

case 65:
if(!Yi&&(djz||aiz))
{
preventDefault(_aoEvent);
var cIf=S("frm",getMainWin());
if(cIf)
{
var cwp=GelTags("table",cIf)[0];
if(cwp)
{
var UR=GelTags("input",cwp)[0];


!UR.addEventListener&&UR.click&&UR.click()
||fireMouseEvent(UR,"click");

}
}
}
break;
}
},

caG:function(ao)
{
ao.Log=ao.log=this.biq("log");
ao.Debug=ao.debug=this.caR("debug");

ao.Trace=ao.trace=this.bKi(ao);
ao.onerror=doPageError;
},

bQv:function(ao)
{
if(ao!=getTop()&&ao==getMainWin())
{

getTop().QMHistory.recordCurrentUrl(ao);
getTop().QMHistory.recordActionFrameChange("clear");


var ae=this,fQ=ao.location.href,
aBW=fQ.indexOf("t=sms_list_v2")>0,
bOF=fQ.indexOf("t=bottle")>0;

addEvents(ao,
{load:function()
{
initAD(ao)
},
unload:function()
{

showProcess(0);
if(isshowMsg()&&getTop().gMsgDispTime
&&now()-getTop().gMsgDispTime>2000)
{
hiddenMsg();
}

aBW&&startWebpush(2);

}
});

aBW&&closeWebpush(2);
bOF&&closeWebpush(4);
getTop().QMWebpushTip&&getTop().QMWebpushTip.hideAll(3000);

ao.setTimeout(function()
{



















if(!(getTop().QQPlusMail&&getTop().QQPlusMail.getPageTitle()))
{
ao.document.title&&(getTop().document.title=ao.document.title);
}

},
200
);
}
},

bRo:function(ao)
{

if(ao==getTop()&&ao.location.href.indexOf("/frame_html")!=-1)
{



















addEvents(ao,{
load:function(e)
{
var cz=getTop().document.body;

function bgw(_aoEvent)
{
var dR=_aoEvent.srcElement||_aoEvent.target;

for(var GK=0;dR&&GK<3;
dR=dR.parentNode,GK++)
{
if(dR.tagName=="A")
{
break;
}
}

return dR||{};
};

function cea(_aoEvent)
{
if((_aoEvent.target||_aoEvent.srcElement)==cz)
{
preventDefault(_aoEvent);
}
}

function bhO(_aoEvent)
{
var dR=bgw(_aoEvent);
if(dR.tagName=="A")
{
if(dR.getAttribute("initlized")!="true")
{
dR.setAttribute("initlized","true");

var bhF=dR.onclick;
dR.onclick=function(bVC)
{
var bK=bVC||getTop().event,
dE=parseInt(dR
.getAttribute("md"));
if(!isNaN(dE)&&dE>0)
{
getTop().clearTimeout(dE);
dR.setAttribute("md","0");

var xP=bK.shiftKey,
aiz=bK.ctrlKey,
bXD=bK.metaKey,
aTq=xP||aiz||bXD,
bdR=trim(dR.href)
.indexOf("http")==0;

function bdv()
{
if(bhF)
{
bhF.call(dR);
preventDefault(bK);
}

if(bdR)
{
if(aTq&&dR.href.indexOf("java")!=0)
{
open(dR.href);
preventDefault(bK);
}
else
{
switch(dR.target)
{
case"mainFrame":
var aT=dR.href;
goUrlMainFrm(
aT+(aT.indexOf("?")!=-1?"#stattime="+now():""),
false
);
preventDefault(bK);
break;
case"_parent":
case"_self":
try
{
ao.location.href=dR.href;
}
catch(Bq)
{
}
preventDefault(bK);
break;
default:
break;
}
}
}
};

if(!aTq
&&dR.getAttribute("nocheck")!="true"
&&(!bdR||dR.target!="_blank"))
{
preventDefault(bK);
QMPageInit
.bcN(bdv);
}
else
{
bdv();
}
}
};
}

dR.setAttribute(
"md",
getTop().setTimeout(
function()
{
dR.setAttribute("md","0");
},
1000
)
);
}

}

function avY(_aoEvent)
{
var dR=bgw(_aoEvent);
if(dR.tagName=="A"
&&dR.getAttribute("initlized")!="true")
{
preventDefault(_aoEvent);
}
}

addEvents(cz,
{
mousewheel:cea,
mousedown:bhO,
keydown:bhO,
click:avY
}
);
}


});
}
},

bYZ:function(ao,_aoEvent)
{
var yJ,
bdJ=["u","1","2","3","4"],
aF=getEventTarget(_aoEvent),
aYO=function(_aoDom)
{
if(_aoDom&&_aoDom.getAttribute)
{
var Jg=_aoDom.getAttribute("t");
for(var i in bdJ)
{
if(bdJ[i]==Jg)
{
return Jg;
}
}
}
};

yJ=aYO(aF);

while(aF&&aF!=ao.document.body&&yJ)
{
if(yJ=="u")
{
aF=aF.parentNode;
yJ=aYO(aF)||yJ;
}
else
{
return aF;
}
}
return null;
},

bdw:function(av,ao,_aoEvent)
{
var aF=this.bYZ(ao,_aoEvent),
bna;
if(!aF&&av=="over"&&(bna=ao["__simpleTipDivShared"]))
{
bna&&addClass(bna,"smt_hide");
bna=null;
}
if(aF)
{
var yJ=aF.getAttribute("t");
switch(yJ)
{
case"1":
case"2":
case"3":
waitFor(
function()
{
return getTop().QMProfileTips;
},
function(oM)
{
if(oM)
{
getTop().QMProfileTips.doMouseEvent(av,ao,aF);
}
}
);
break;
case"4":
var aoD="simpletip",
aWu="stitle",
bgE="smt_hide";
if(aF.title)
{
aF.setAttribute(aWu,aF.title);
aF.title="";
}
if(av=="over")
{
var hH=aF.getAttribute(aWu),
sZ=S(aoD,ao);
if(!sZ)
{
insertHTML(ao.document.body,"afterBegin",'<div id="'+aoD+'" class="smt_container smt_up smt_hide"><span class="smt_inner"></span></div>');
sZ=S(aoD,ao);
}
if(sZ)
{
sZ.firstChild.innerHTML!=hH&&(sZ.firstChild.innerHTML=hH);
rmClass(sZ,bgE);

var ND=calcPos(aF),
aTV=(ND[1]+ND[3])/2;
ND[0]-=3;
ND[2]+=3;

var	da=parseInt(sZ.offsetHeight),
cH=parseInt(sZ.offsetWidth),
_oPos=calcAdjPos([ND[0],aTV,ND[2],aTV],cH,da,ao,2),
iJ=sZ.className,
bdt=_oPos[2]==ND[0]?"smt_down":"smt_up";
if(iJ.indexOf(bdt)<0)
{
sZ.className="smt_container "+bdt;
}
sZ.style.top=_oPos[0]+"px";
sZ.style.left=(_oPos[3]-cH/2)+"px";
ao["__simpleTipDivShared"]=sZ;
}
}
else if(av=="out")
{
var sZ=S(aoD,ao);
sZ&&addClass(sZ,bgE);
ao["__simpleTipDivShared"]=null;
}
break;
}
}
},

bMg:function(ao)
{
ao.call=function()
{
var aZ=arguments,bdi=[],i,l,
eQ=aZ[0].split("."),
ae=hI=ao;

for(i=1,l=aZ.length;i<l;i++)
{
bdi.push(aZ[i]);
}

for(i=0,l=eQ.length;i<l&&hI;i++)
{
ae=hI;
hI=hI[eQ[i]];
}

if(typeof hI=="function")
{
return hI.apply(ae,bdi);
}
}
},



bLZ:function(ao)
{
var ae=this;
ao.setTimeout(
function()
{
var bVb=(ao.location.getParams
&&ao.location.getParams()["t"]||"")
.indexOf("compose")==0;

addEvents(ao.document,
{
mousedown:hideMenuEvent,
touchend:getTop().iPadCloseMenu||function(){},
keydown:function(_aoEvent)
{

ae.bQM(_aoEvent,bVb);
},
click:function(_aoEvent)
{
hideEditorMenu();


getTop().QMWebpushTip&&getTop().QMWebpushTip.hideAll(3000);
},
mouseover:function(_aoEvent)
{
ae.bdw("over",ao,_aoEvent);
},
mouseout:function(_aoEvent)
{
ae.bdw("out",ao,_aoEvent);
}
}
);
},100
);
},

adx:function(ao)
{
ao=ao||window;

if(ao.gIsInitPageEventProcess)
{
return;
}

ao.gIsInitPageEventProcess=true;

var kU=0;
try
{
kU=1;
this.caG(ao);

kU=2;
this.bGZ(ao);

kU=3;
this.bQv(ao);

kU=4;
this.bRo(ao);

kU=5;
this.bLZ(ao);

kU=6;
this.bMg(ao);
}
catch(bc)
{
doPageError(bc.message,ao.location.href,
"initPageEvent_processid:"+kU
);
}

try
{

ao.document.execCommand("BackgroundImageCache",false,true);
}
catch(bc)
{
}
},

bcN:function(asZ)
{
try
{
if(getMainWin().exitConfirm)
{
return getMainWin().exitConfirm(asZ);
}
}
catch(bc)
{
debug(bc.message);
}


asZ();
}
}





function initPageEvent(ao)
{
QMPageInit.adx(ao);
}

(function()
{
initPageEvent(window);
})();






function getTopWin()
{
return getTop();
}





function getMainWin()
{
return F("mainFrame",getTop())||getTop();
}





function getActionWin()
{
return F("actionFrame",getTopWin());
}





function getLeftWin()
{
return getTop();
}
var GetLeftWin=getLeftWin;





function getLeftDateWin()
{
return F("leftFrame",getTop());
}






function reloadFrm(ao)
{
if(ao&&ao!=getTop())
{
try
{
if(ao.location.search)
{


var aqW=ao.location.href.split("#")[0].split("?"),
bcF="r="+now();
aqW[1]=!aqW[1]?bcF:
(("&"+aqW[1]+"&").replace(/&r=.*?&/,"&")+bcF).slice(1);
ao.location.replace(aqW.join("?"));
return true;
}
}
catch(bc)
{
}
}
return false;
}




function reloadLeftWin()
{
var DJ;
if(!reloadFrm(getLeftDateWin())&&(DJ=S("leftFrame",getTop())))
{
DJ.src=T('/cgi-bin/folderlist?sid=$sid$&r=$rand$').replace(
{
sid:getSid(),
rand:Math.random()
}
);
}
}








function reloadAllFrm(dLi,ejD,aoO,aoa)
{
function MJ(bQj)
{
var aWB=arguments.callee;
getTop().setTimeout(bQj,aWB.kI);
aWB.kI+=200;
}
MJ.kI=0;

if(aoa==null||aoa)
{
MJ(
function()
{
reloadFrm(getMainWin());
}
);
}

if(aoO==null||aoO)
{
MJ(
function()
{
reloadFrm(reloadLeftWin());
}
);
}
}






function reloadFrmLeftMain(aoO,aoa)
{
reloadAllFrm(false,false,aoO,aoa);
}













function goUrlTopWin(bj,bUf)
{

goUrl(getTop(),bj,!bUf);
}







function goUrlMainFrm(bj,bRD,aXp)
{
if(bRD!=false)
{
reloadLeftWin();
setTimeout(
function()
{
goUrl(S("mainFrame",getTop())||getTop(),bj,!aXp);
},
300
);
}
else
{
goUrl(S("mainFrame",getTop())||getTop(),bj,!aXp);
}
}

function bNY(ahW)
{
return ahW&&ahW.substr&&("?"+(["&",ahW.substr(1),"&"].join("")
.replace(/&sid=.*?&/ig,"&")
.replace(/&loc=.*?&/ig,"&")
.replace(/&newwin=true/ig,"&")
.slice(1,-1)));
}










function goNewWin(VY,cao,bXh,aom)
{
var ahw="",
Fo="",
my="";

if(typeof(VY)=="object")
{
ahw=VY.pathname;
Fo=VY.search;
}
else
{
var wB=VY.indexOf("?");
ahw=VY.substring(0,wB);
Fo=VY.substr(wB);
}

if(aom)
{
my=aom.frametmpl;
}
else
{
my=bXh?"frame_html":"newwin_frame";
}

var aWy='';
if(ahw.indexOf('reader_')>-1)
{
aWy=getTop().location.protocol+"//mail.qq.com";
}

var aT=T(aWy+'/cgi-bin/frame_html?t=$t$&sid=$sid$&url=$url$').replace(
{
t:my,
sid:getSid(),
url:encodeURI(ahw+bNY(Fo))
}
);

if(aom)
{
aT+=aom.frametmplparam;
}

if(cao)
{
goUrlTopWin(aT,true);
}
else
{

window.open(aT);
}
}






function isMaximizeMainFrame()
{
return getTop().maximizeMainFrame.ccp;
}






function maximizeMainFrame(aqP)
{
var aAE=S("mainFrame",getTop()),
aqu=S("leftPanel",getTop()),
aqJ=S("imgLine",getTop());

if(!aAE||!aqJ||!aqu
||aqP!=2&&(aqP==0)==!isMaximizeMainFrame())
{
return false;
}

var abY=getTop().maximizeMainFrame,
JM=abY.ccp=aqP==2
?!isMaximizeMainFrame():(aqP?true:false);

if(JM)
{
abY.bOx=aqu.style.width;
abY.bSe=aqJ.parentNode.style.cssText;
}

aAE.parentNode.style.marginLeft=
JM?"5px":abY.bOx;
aqu.parentNode.style.cssText=
JM?"border-left:none;":"";
aqJ.parentNode.style.cssText=
(JM?"border-left:none;margin-left:0;padding:0;":"")+abY.bSe;

show(aqu,!JM);
show(aqJ,!JM);
show(S("qqplus_panel",getTop()),!JM);
show(S("folder",getTop()),!JM);
}







function filteSignatureTag(bG,cX)
{
var fG=typeof bG=="string"?bG:"";

if(cX=="2LOWCASE")
{
return fG.replace(/<sign(.*?)\/>/ig,"<sign$1>")
.replace(/<qzone(.*?)\/>/ig,"<qzone$1>")
.replace(/<taotao(.*?)\/>/ig,"<taotao$1>")
.replace(/<\/sign>/ig,"</sign>")
.replace(/<\/qzone>/ig,"</qzone>")
.replace(/<\/taotao>/ig,"</taotao>")
.replace(/<(\/?)includetail>/ig,"<$1tincludetail>");
}
if(cX=="FILTE<:")
{
return fG.replace(/<:sign.*?>/ig,"")
.replace(/<:qzone.*?>/ig,"")
.replace(/<:taotao.*?>/ig,"")
.replace(/<:includetail.*?>/ig,"");
}
else
{
return fG.replace(/<\/?sign.*?>/ig,"")
.replace(/<\/?qzone.*?>/ig,"")
.replace(/<\/?taotao.*?>/ig,"")
.replace(/<\/?includetail.*?>/ig,"");
}
}





function getSignatureHeader()
{
return T([
'<div style="color:#909090;font-family:Arial Narrow;font-size:12px">',
'------------------',
'</div>'
]);
}





window.g_sBaseImageUrl=getTop().getPath("stationery");
if(!getTop().goUserInfo)
{
getTop().goUserInfo=
{
dF:'init',
aAz:{},
aw:{},
eiX:function()
{
for(var obj in getTop().goUserInfo.aAz)
{
for(var i=0,l=getTop().goUserInfo.aAz[obj].length;i<l;i++)
{
try{
getTop().goUserInfo.aAz[obj][i](getTop().goUserInfo.get(obj));
}catch(e){}
}
}
getTop().goUserInfo.aAz={};
},
get:function(bm)
{
if(getTop().goUserInfo.dF=='init')
{
getTop().goUserInfo.reset();
return'';
}
else
{
if(typeof getTop().goUserInfo.aw[bm]==='undefined')
{
return'';
}
return getTop().goUserInfo.aw[bm];
}
},
deferget:function(bm,iV)
{
if(getTop().goUserInfo.dF=='init')
{
if(typeof getTop().goUserInfo.aAz[bm]==='undefined')
{
getTop().goUserInfo.aAz[bm]=[];
}
getTop().goUserInfo.aAz[bm].push(iV);
getTop().goUserInfo.reset();
}
else
{
iV(getTop().goUserInfo.aw[bm]);
}
},
set:function(eb)
{
extend(getTop().goUserInfo.aw,eb);
},
reset:function()
{
if(getTop().goUserInfo.dF=='loading')
{
return;
}
getTop().goUserInfo.dF='loading';

var aT=T(["/cgi-bin/getcomposedata?t=signature&fun=compose&sid=$sid$&qzonesign=$qzonesign$&r=$rand$"])
.replace({
sid:getSid(),
qzonesign:"",
rand:now()
});
QMAjax.send(aT,
{
method:"GET",
timeout:10000,
headers:{"If-Modified-Since":"0","Cache-Control":"no-cache, max-age=0"},
onload:function(aY,bN)
{
var gE=trim2(bN);

if(aY&&gE.indexOf("(")==0)
{
getTop().goUserInfo.dF='ready';
getTop().goUserInfo.set(
(function(){
return(new Function("return "+gE))();
})()
);
bindAccount();
}
else
{
getTop().goUserInfo.dF='init';
}
getTop().goUserInfo.eiX();
}
});
}
};
}






function setDefaultSender(oG)
{

getTop().goUserInfo.set({"DEF_MAIL_FROM":oG});

}

function getMailZoomTool()
{
return getTop().goUserInfo.get("DEF_MAILZOOMTOOL")=="1";
}

function setMailZoomTool(Wx)
{
getTop().goUserInfo.set({"DEF_MAILZOOMTOOL":Wx?"1":"0"});
}





function closeRecognizeNickName()
{
ossLog("realtime","all","stat=tips&type=know&tipid=66");
getTop().goUserInfo.set({"DEF_RECOGNIZENICKNAME":false});
}






function getUserInfoText(av)
{
var dD=S("user"+av,getTopWin())||{};
return fixNonBreakSpace(dD.innerText||dD.textContent);
}






function getUserInfo(av)
{
return(S("user"+av,getTopWin())||{}).innerHTML||"";
}







function setUserInfo(av,bJ)
{
try
{
S("user"+av,getTopWin()).innerHTML=htmlEncode(bJ);
return true;
}
catch(bc)
{
return false;
}
}










function msgBox(_asMsg,Xs,aoe,DC,
aWz,ao)
{
if(window!=getTop())
{
return getTop().msgBox(_asMsg,Xs,aoe,DC,
aWz,ao);
}

var fl=_asMsg;

if(!fl)
{
var VL=S("msg_txt",ao||window)
||S("msg_txt",getActionWin());

if(VL&&(VL.innerText||VL.textContent)
&&VL.getAttribute("ok")!="true")
{
fl=filteScript(VL.innerHTML);
VL.setAttribute("ok","true");
}
}

if(!fl||!(fl=trim(fl.replace(/[\r\n]/ig,""))))
{
return;
}

hiddenMsg();

if(Xs=="dialog")
{
alertBox(
{
msg:fl,
title:aWz||"\u786E\u8BA4"
}
);
}
else
{
setClass(arguments.callee.createMessageBox().firstChild,
Xs=="success"?"msg":"errmsg").innerHTML=fl;

showMsg();

if(aoe)
{
getTop().gMsgBoxTimer=getTop().setInterval(getTop().hiddenMsg,DC||5000);
}

getTop().gMsgDispTime=now();
}
};




msgBox.createMessageBox=function(Mx)
{
var Un=S("msgBoxDIV",getTop());
if(!Un)
{

var bU=typeof Mx=="undefined"?(getTop().bnewwin?0:43):Mx;
insertHTML(
getTop().document.body,
"afterBegin",
T([
'<div id="msgBoxDIV" style="position:absolute;width:100%;display:none;',
'padding-top:2px;height:24px;*height:24px;_height:20px;top:$top$px;text-align:center;">',
'<span></span>',
'</div>'
]).replace({
top:bU
})
);
Un=S("msgBoxDIV",getTop());
}
return Un;
};





function isshowMsg()
{
return getTop().isShow("msgBoxDIV");
}




function hiddenMsg()
{
if(getTop().gMsgBoxTimer)
{
getTop().clearInterval(getTop().gMsgBoxTimer);
getTop().gMsgBoxTimer=null;
}
getTop().show("msgBoxDIV",false);
getTop().showProcess(0);
}






function displayGrayTip(_aoDom,gg)
{
var cL=_aoDom.style;

cL.visibility=!gg?"hidden":"";
cL.height=!gg?"0":"";
}




function showMsg()
{
getTop().show("msgBoxDIV",true);
}







function showError(hN,DC,cSE)
{
msgBox(hN,"",DC!=-1,DC||5000);
var Un=S("msgBoxDIV",getTop());
if(Un&&cSE)
{
var akg=[];
E(GelTags("script",Un),function(aNQ)
{
akg.push(aNQ.innerHTML);
}
);
globalEval(akg.join(";"),getTop());
}
}






function showInfo(ccy,DC)
{
msgBox(ccy,"success",DC!=-1,DC||5000);
}











function showProcess(CB,bOB,aEy,aUd,bLw)
{
var aU="load_process",
bbs=arguments.callee.bof(aU);

if(CB==0)
{
return show(bbs,false);
}

hiddenMsg();
show(bbs,true);

var WR=CB==2;

if(WR)
{
var hG=parseInt(aEy);

if(isNaN(hG))
{
hG=0;
}
else
{
hG=Math.max(0,Math.min(100,hG));
}
if(aUd)
{
S(aU+"_plan_info",getTop()).innerHTML=aUd+(hG?":":"");
}

S(aU+"_plan_rate",getTop()).innerHTML=
S(aU+"_plan_bar",getTop()).style.width=[hG,"%"].join("");
}
else
{
if(aEy)
{
S(aU+"_info",getTop()).innerHTML=aEy;
}
}

show(S(aU+"_plan",getTop()),WR);
show(S(aU+"_img",getTop()),WR?false:bOB);
show(S(aU+"_plan_info",getTop()),WR);
show(S(aU+"_plan_rate",getTop()),WR&&hG);
show(S(aU+"_info",getTop()),!WR);
show(S(aU+"_cancel",getTop()),bLw!=false);
}






showProcess.bof=function(aI)
{
var aEO=S(aI,getTop());
if(!aEO)
{
insertHTML(
getTop().document.body,
"afterBegin",
T([
'<table id="$id$" cellspacing=0 cellpadding=0 border=0 ',
'style="position:absolute;top:$top$px;left:0;width:100%;display:none;z-index:9999;">',
'<tr><td align="center">',
'<table cellspacing=0 cellpadding=0 border=0 class="autosave autosave_txt" style="height:20px;"><tr>',
'<td style="width:2px;"></td>',
'<td id="$id$_img" style="padding:0 0 0 5px;">',
'<img src="$image_path$ico_loading0aa5d9.gif" style="width:16px;height:16px;vertical-align:middle;">',
'</td>',
'<td id="$id$_plan" valign=center style="padding:0 0 0 5px;">',
'<div style="font:1px;border:1px solid white;width:104px;text-align:left;">',
'<div id="$id$_plan_bar" style="font:1px;background:#fff;height:8px;margin:1px 0;width:50%;"></div>',
'</div>',
'</td>',
'<td id="$id$_plan_info" style="padding:0 0 0 5px;"></td>',
'<td id="$id$_plan_rate" style="width:40px;text-align:right;padding:0;"></td>',
'<td id="$id$_info" style="padding:0 0 0 5px;"></td>',
'<td id="$id$_cancel" style="padding:0 0 0 5px;">',
'[<a onclick="getTop().cancelDoSend();" nocheck="true" style="color:white;">\u53D6\u6D88</a>]',
'</td>',
'<td style="padding:0 0 0 5px;"></td>',
'<td style="width:2px;"></td>',
'</tr></table>',
'</td></tr>',
'</table>'
]).replace(
{
id:aI,
top:getTop().bnewwin?0:45,
image_path:getPath("image",true)
}
)
);
aEO=S(aI,getTop());
}
return aEO;
};





function getProcessInfo()
{
var aU="load_process",
nP=getTop();

if(isShow(S(aU,nP)))
{
var aVT=S(aU+"_plan_rate",nP),
aCM=S(aU+"_info",nP);

if(aCM&&isShow(aCM))
{
return aCM.innerHTML;
}

if(aVT&&isShow(S(aU+"_plan",nP)))
{
return parseInt(aVT.innerHTML);
}
}
return"";
}






function replaceCss(ao,wI)
{
replaceCssFile(
"skin",
[getPath("style"),getFullResSuffix(["skin",
typeof wI=="undefined"?getPath("skin"):wI,".css"].join(""))
].join(""),
(ao||window).document
);
}






function aTy(wI,aqK)
{
var _oTop=getTop();

return!aqK&&_oTop.gLogoUrl?_oTop.gLogoUrl.replace(/(.*)_[^_]+_([^_]+)/,"$1_"+wI+"_$2")
:TE([
'$images_path$logo',
'$@$if($bFoxmail$)$@$',
'_foxmail',
'$@$else$@$',
'$sSubfolder$',
'$@$endif$@$',
'/logo_$nSkinId$_',
'$@$if($bFoxmail$)$@$',
'0',
'$@$else$@$',
'$sLogoid$',
'$@$endif$@$.gif'
]).replace(
{
images_path:getPath("image"),
bFoxmail:aqK,
sSubfolder:_oTop.gsLogoFolder,
nSkinId:wI,
sLogoid:(_oTop.gsLogoFolder||wI==0)?(_oTop.gLogoId||0):0
}
);
}








function doRealChangeStyle(bOM,wI,aqK,vj,cff)
{
var _oTop=getTop(),
Kg=_oTop.gTempSkinId=wI,
cy=getMainWin(),
aCl=[_oTop,cy],
bTI=cff||false,
amy=S("imglogo",_oTop);

if(amy)
{
if(typeof vj=="undefined"||vj=="")
{
if(wI<10000000)
{
amy.src=aTy(Kg,aqK);











}
}
else
{
amy.src=vj;
}
amy.className=bTI?"domainmaillogo":"";
}







E(_oTop.goDialogList,function(lc,wi)
{
aCl.push(F(wi,getTop()));
});

E(GelTags("iframe",cy.document),function(lc)
{
aCl.push(lc.contentWindow);
});

E(aCl,function(ao)
{
replaceCss(ao,Kg);
});

removeSelf(bOM);

setTimeout(resizeFolderList);

rdVer("BaseVer",1);
}






function changeStyle(wI,vj)
{
var alc=false,
aqf=false;


var amr=getTop().getGlobalVarValue("DOMAIN_MAIL_LOGO_URL")||{},
NK=getTop().goUserInfo.get("DEF_MAIL_FROM")||'';
if(vj)
{
aqf=vj.indexOf("/cgi-bin/viewfile")>=0;
if(aqf)
{
amr[NK]=vj;
NK&&setGlobalVarValue("DOMAIN_MAIL_LOGO_URL",amr);
}
}
else if(NK&&amr[NK])
{

vj=amr[NK];
aqf=vj&&vj.indexOf("/cgi-bin/viewfile")>=0;
}

var Kg=typeof wI=="undefined"||wI==""?getTop().skin_path:wI,
bPL=getTop().gsLogoFolder,
bVG=alc?0:(bPL||Kg==0?(getTop().gLogoId||0):0),
cdM=alc?"_foxmail":"",
aWl=getTop().changeStyle,
bMj=aWl.aFh,
aFh=aWl.aFh=["skinCssCache",Kg,
cdM,vj||bVG].join("_");


if(aFh!=bMj)
{
cacheByIframe([
["css",getPath("style"),"skin"+Kg+".css"],
!!vj?["img","",vj]

:["img",aTy(Kg,alc)]
],
{
onload:function()
{
doRealChangeStyle(this,Kg,alc,vj,aqf);
}
}
);
}
}




function osslogCompose(gZ,aEi,aP,aAk,aFX)
{
getTop().ossLog("delay","all",T([
'stat=compose_send',
'&t=$time$&actionId=$actionId$&mailid=$mailid$',
'&isActivex=$isActivex$&failCode=$failCode$',
'&$other$'
]).replace({
time:gZ,
actionId:aEi,
mailId:aP,
failCode:aAk,
other:["&cgitm=",getTop().g_cgiTimeStamp||-1,"&clitm=",getTop().g_clientTimeStamp||-1,"&comtm=",aFX&&aFX.valueOf?aFX.valueOf():-1].join('')
}));
}

function osslogAjaxCompose(zm,BH,ln,av)
{
var _oTop=getTop(),
bNE=["IE","FF","Safari","Chrome","Opera","QBIE","TT","NS"],
LQ="gbIs",
cQE="Other";
for(var i=0;i<bNE.length;i++)
{
if(_oTop[LQ+bNE[i]])
{
cQE=bNE[i];
break;
}
}
ossLog("delay","all",T([
'stat=compose_ajax_send',
'&server=$server$&browser=$browser$',
'&status=$status$&code=$code$&section=$section$&sendtype=$type$&ran=$ran$',
]).replace(
{
ran:now(),
server:getCookie("ssl_edition")||location.host,
browser:cQE,

status:zm,
code:BH,
section:ln,
type:av
}
));
}








function recodeComposeStatus(aEi,aP,aAk,bZG)
{
var eV=0,
adL=getTop().gSendTimeStart;

if(!adL||!adL.valueOf)
{
if(!bZG)
{
return;
}
}
else
{
eV=now()-adL.valueOf();
getTop().gSendTimeStart=null;
}



osslogCompose(eV,aEi,aP,aAk,adL);













getTop().isUseActiveXCompose=false;
}




function errorProcess(Wj)
{

if(typeof getMainWin().ErrorCallBack=="function")
{
getMainWin().ErrorCallBack(Wj);

}
else if(typeof getTop().ErrorCallBack=="function")
{
getTop().ErrorCallBack(Wj);
}
}







function doPostFinishCheck(aI,ao,brR)
{
if(aI)
{
var vF="",
agi=false,
DJ=S(aI,ao),
amK=F(aI,ao),
btX=-1;
try
{
btX=0;
if(!DJ
||DJ.getAttribute("deleted")=="true")
{
return;
}

btX=1;
var cz=amK.document.body,
agi=!cz.className&&!cz.style.cssText;

btX=2;
if(agi)
{
var Ba=amK.document.documentElement;
vF=(Ba.textContent
||Ba.innerText||"").substr(0,30);
}




}
catch(bc)
{
doPageError([aI,bc.message].join(":"),amK&&amK.location&&amK.location.href||aI,btX);
agi=bc.message||"exception";
}

QMHistory.recordActionFrameChange();

if(agi)
{
callBack.call(DJ,brR,[vF]);












errorProcess();
}
}
}




function actionFinishCheck()
{
doPostFinishCheck("actionFrame",getTop(),function(responseContent)
{
showError(gsMsgLinkErr);
}
);
}




function doSendFinishCheck()
{
doPostFinishCheck("sendmailFrame",getTop(),function(ahK)
{
recodeComposeStatus(2,null,ahK||0);
msgBox(T(['\u7531\u4E8E\u7F51\u7EDC\u539F\u56E0\uFF0C\u90AE\u4EF6\u53D1\u9001\u5931\u8D25\uFF01'
,'[<a href="/cgi-bin/switch2service?sid=$sid$&errcode=-1&time=$time$&cginame=sendmail&t=error_report">\u53D1\u9001\u9519\u8BEF\u62A5\u544A</a>]']).replace(
{
time:formatDate(new Date(),"$YY$$MM$$DD$$hh$$mm$$ss$")
}
),"dialog",true,0,"\u5931\u8D25\u4FE1\u606F");
}
);
}






function submitToActionFrm(mf)
{
try
{
mf.submit();
return true;
}
catch(bc)
{
showError(mf.message);
return false;
}
}









function afterAutoSave(tT,aP,_asMsg,bvs)
{

var kU=0,
Ab,auR;

try
{
var cy=getTop().getMainWin();

function arE()
{
if(disableAll)
{
disableAll(false);
}
}

kU=1;

if(aP==""||!aP)
{
return arE();
}

kU=2;

if(!cy||!S("fmailid",cy))
{
return arE();
}

kU=3;
auR=S("fmailid",cy).value;

if(auR!=aP)
{
S("fmailid",cy).value=aP;
getTop().setTimeout(
function()
{
reloadLeftWin()
},
0
);
}

kU=4;

var _oFiles=tT.split(" |"),
Ll=[],
awt=cy.QMAttach.getExistList();

for(var i=0,_nLen=awt.length;i<_nLen;i++)
{
var aah=S("Uploader"+awt[i],cy);
if(aah&&!aah.disabled&&aah.value!="")
{
Ll.push(aah);
}
}

kU=5;

var bre=Ll.length;
for(var i=0,_nLen=_oFiles.length-1;i<_nLen;i++)
{
var BU=false;
for(var j=0;j<=i&&j<bre;j++)
{
if(!Ll[j].disabled
&&Ll[j].value.indexOf(_oFiles[i])!=-1)
{
Ll[j].disabled=true;
BU=true;
try
{
if(gbIsIE||gbIsWebKit)
{
Ll[j].parentNode.childNodes[1].innerText=_oFiles[i];
}
}
catch(bc)
{
}
}
}
if(!BU)
{
var aQ=_oFiles[i]+" |",
ec=tT.indexOf(aQ);

if(ec!=-1)
{
tT=tT.substr(0,ec)
+tT.substr(ec+aQ.length,
tT.length-ec-aQ.length
);
}
}
}

kU=6;

cy.loadValue();

kU=7;

if(tT&&S("fattachlist",cy))
{
S("fattachlist",cy).value+=tT;
}

kU=8;







kU=9;

showInfo(_asMsg
||(formatDate(new Date,"$hh$:$mm$")+" "+getTop().gsMsgSendErrorSaveOK));

kU=10;
var en=getTop().QMDialog("composeExitAlert");
var iS=en&&en.S("btn_exit_notsave");
if(iS&&iS.isShow())
{
return fireMouseEvent(iS,"click");
}

kU=11;

if(!bvs)
{
arE();
}

kU=12;

cy.enableAutoSave();
}
catch(bc)
{
Ab=bc.message;
debug(["afterAutoSave:",bc.message,"eid:",kU]);
}









}




function cancelDoSend()
{
var cy=getMainWin(),
Rc=cy.QMAttach;

if(Rc&&Rc.onfinish)
{
Rc.onprogress=null;
Rc.onfinish=null;
}
else
{
var amk=S("sendmailFrame",getTop());
if(amk)
{
amk.setAttribute("deleted","true");
removeSelf(amk);
}
}

recodeComposeStatus(3,null,0);
showProcess(0);
errorProcess();
}







function quickDoSend(sg,bJ,_asMsg)
{
var aGK=false;

if(_asMsg!="nomsg")
{
showProcess(1,0,[
"<img src='",getPath("image"),"newicon/a_send.gif' width='14px' height='14px' align='absmiddle'>&nbsp;",
(_asMsg||gsMsgSend)].join(""),null,true);
}

disableSendBtn(true);
disableSource(true);

createBlankIframe(getTop(),
{
id:"sendmailFrame",
onload:function(ao)
{
if(aGK)
{
doSendFinishCheck(this);
}
else
{
aGK=true;

try
{
sg.content.value=bJ;
sg.target="sendmailFrame";
sg.submit();
}
catch(bc)
{
showError("\u53D1\u9001\u5931\u8D25\uFF1A"+bc.message);
disableSendBtn(false);
disableSource(false);
}
}
}
}
);
}






function disableSendBtn(sW,ao)
{
disableCtl("sendbtn",sW,ao||getMainWin());
}





function disableSaveBtn(sW,ao)
{
disableCtl("savebtn",sW,ao||getMainWin());
}





function disableTimeSendBtn(sW,ao)
{
disableCtl("timeSendbtn",sW,ao||getMainWin());
}





function disableSource(sW)
{
disableCtl("source",sW,getMainWin());
}




function disableAll(sW,ao)
{
var cy=ao||getMainWin();
if(cy.disableAll&&cy.disableAll!=arguments.callee)
{
return cy.disableAll(sW);
}

disableSendBtn(sW,ao);
disableSaveBtn(sW,ao);
disableTimeSendBtn(sW,ao);

var en=getTop().QMDialog("composeExitAlert"),
aXu=en&&en.S("btn_exit_save");
if(aXu)
{
aXu.disabled=sW;
}
}






function verifyCode(av,PJ)
{
if(window!=getTop())
{
return getTop().verifyCode(cjt);
}

var Av=arguments.callee,

cbN=Av.bNR;


setVerifyCallBack();
loadingBox(
{
model:"\u9A8C\u8BC1\u7801",
js:"$js_path$qmverify0df7dc.js",
oncheck:function()
{
return window.QMVerifyBox;
},
onload:function()
{
QMVerifyBox.open(
{
sType:av,
sVerifyKey:PJ,
onok:cbN
}
);
}
}
);
}
























function openComposeDlg(blx,aj,bcX)
{
!(typeof QMAddress!="undefined"&&QMAddress.isInit())&&initAddress();



loadJsFileToTop(["$js_path$com/kits/qmeditor/js/editor0f0f4f.js"]);
loadingBox(
{
model:"\u53D1\u4FE1",
js:["$js_path$libcompose0e0e70.js","$js_path$qmaddrinput0de70b.js"],
oncheck:function()
{
return window.ComposeLib&&window.QMAddrInput&&window.QMEditor&&(!bcX||bcX());
},
onload:function()
{
ComposeLib.openDlg(blx,aj);
}
}
);
}










function setVerifyCallBack(bC)
{
getTop().verifyCode.bNR=bC;
}







function emptyFolder(ckS,bKl,bkq)
{
confirmBox({
title:"\u6E05\u7A7A\u6587\u4EF6\u5939",
msg:T([
'<div class="dialog_f_t">\u662F\u5426\u8981\u6E05\u7A7A$name$\uFF1F</div>',
'<div class="dialog_f_d">\u6E05\u7A7A\u540E\u90AE\u4EF6\u5C06\u65E0\u6CD5\u6062\u590D\u3002</div>'
]).replace({
name:(bkq?"\u6B64\u6587\u4EF6\u5939":bkq+"\u4E2D\u7684\u90AE\u4EF6")

}),
confirmBtnTxt:'\u662F',
cancelBtnTxt:'\u5426',
onreturn:function(aY)
{
aY&&bKl();
}
});




}








function renameFolder(eI,av,ao,bwB)
{
promptFolder({
defaultValue:bwB||'',
type:"rename"+(av||'folder'),
onreturn:function(jn){
var fX=S("frm",ao);
if(av=='tag')
{
fX.fun.value="renametag";
fX.tagname.value=jn;
fX.tagid.value=eI;
}
else
{
fX.fun.value="rename";
fX.name.value=jn;
fX.folderid.value=eI;
}
submitToActionFrm(fX);
}
});
return false;
}











function promptFolder(aj)
{
var aR={
shortcutgroup:{title:'\u65B0\u5EFA\u8054\u7CFB\u4EBA\u5206\u7EC4',msg:'\u8BF7\u586B\u5199\u8054\u7CFB\u4EBA\u5206\u7EC4\u540D\u79F0',name:'\u8054\u7CFB\u4EBA\u5206\u7EC4',maxascii:32,description:"\u5199\u4FE1\u65F6\uFF0C\u53EA\u9700\u8981\u8F93\u5165\u8FD9\u4E2A\u7FA4\u7EC4\u540D(\u6C49\u5B57\u9700\u8F93\u5165\u62FC\u97F3)\uFF0C\u5C31\u53EF\u4EE5\u5FEB\u6377\u7FA4\u53D1\u4E86\u3002"},
folder:{title:'\u65B0\u5EFA\u6587\u4EF6\u5939',msg:'\u8BF7\u60A8\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0',name:'\u6587\u4EF6\u5939',maxascii:80},
tag:{title:'\u65B0\u5EFA\u6807\u7B7E',msg:'\u8BF7\u60A8\u8F93\u5165\u6807\u7B7E\u540D\u79F0',name:'\u6807\u7B7E',maxascii:50},
renamefolder:{title:'\u91CD\u547D\u540D\u6587\u4EF6\u5939',msg:'\u8BF7\u60A8\u8F93\u5165\u65B0\u7684\u6587\u4EF6\u5939\u540D\u79F0',name:'\u6587\u4EF6\u5939',maxascii:80},
renametag:{title:'\u91CD\u547D\u540D\u6807\u7B7E',msg:'\u8BF7\u60A8\u8F93\u5165\u65B0\u7684\u6807\u7B7E\u540D\u79F0',name:'\u6807\u7B7E',maxascii:50}
}[aj.type];
aR.defaultValue=aj.defaultValue;

aj.width&&(aR.width=aj.width);
aj.height&&(aR.height=aj.height);
aj.bAlignCenter&&(aR.bAlignCenter=aj.bAlignCenter);
aj.onclose&&(aR.onclose=aj.onclose);
aj.style&&(aR.style=aj.style);

aR.onreturn=function(aY,fm){
if(!aY)
{
return;
}

var _nLen=getAsiiStrLen(trim(fm));
if(_nLen==0||_nLen>aR.maxascii)
{
return showError(TE(_nLen?"$name$\u540D\u79F0\u592A\u957F\uFF0C\u8BF7\u4F7F\u7528\u5C11\u4E8E$maxascii$\u4E2A\u5B57\u7B26($@$eval $maxascii$/2$@$\u4E2A\u6C49\u5B57)\u7684\u540D\u79F0":'$name$\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A').replace(aR));
}
if(/[~!#\$%\^&\*\(\)=\+|\\\[\]\{\};\':\",\?\/<>]/.test(fm))
{
return showError(aR.name+'\u540D\u79F0\u4E0D\u80FD\u5305\u542B ~!#$%^&*()=+|\\[]{};\':",?/<> \u7B49\u5B57\u7B26');
}

aj.onreturn(fm);
};
promptBox(aR);
}


function bab(eI,Zn,apl,cX)
{
if(eI)
{
var aEz=S(eI+"_td",Zn);
if(aEz)
{
setClass(aEz,apl);
return aEz;
}
else
{

var aDs=S(eI,Zn);
if(aDs)
{
var aXO=cX=="over";
if(aXO)
{
showFolders(aDs.name,true);
}
var ceq=S(eI,Zn).parentNode;
setClass(ceq,aXO?"fn_list":"");
return aDs;
}
}
}
}











function switchFolderComm(aI,ao,awQ,jE,bYD,
cfj,baY)
{
var aEV=S(awQ,ao),
jY=aI;

if(jY)
{
baY.bOA=jY;
}
else
{
jY=baY.bOA;
}

if(aEV)
{
var aYa="SwiTchFoLdErComM_gLoBaldATa",
aZT=ao[aYa],
aek;

if(aZT!=jY)
{
bab(aZT,ao,cfj,"none");
}

if(aek=
bab(ao[aYa]=jY,ao,bYD,"over"))
{

E("new|personal|pop|tag".split("|"),function(baU)
{
var Vy=S(baU+"folders",ao);
Vy&&isObjContainTarget(Vy,aek)
&&showFolders(baU,true);
}
);

if(getStyle(aEV,"overflow")!="hidden")
{

scrollIntoMidView(aek,aEV);
}
else
{

var Vy=S("ScrollFolder",ao);
Vy&&isObjContainTarget(Vy,aek)
&&scrollIntoMidView(aek,Vy);
}
}
}
}






function switchFolder(aI,ao)
{
getTop().switchFolderComm(aI,ao||getLeftWin(),"folder","li","fn","fs",
getTop().switchFolder
);
}







function switchRightFolder(aI,bJK,awQ)
{
getTop().switchFolderComm(aI,bJK||F("rightFolderList",getMainWin()),
awQ||"folder_new","div","toolbg","",getTop().switchRightFolder
);
}






function isShowFolders(aI,ao)
{
var tw=S("icon_"+aI,ao||getTop());
return!!(tw&&tw.className=="fd_off");
}





function showFolders(aI,nh,ao)
{
var az=ao||getTop(),
_oContainer=S(aI+"folders",az),
tw=S("icon_"+aI,az);

if(_oContainer&&tw)
{
var jp=S(aI+"folders",az),
bIf=GelTags("li",jp).length;

var hB=!isShowFolders(aI,az);
if(bIf&&(typeof nh!="boolean"||hB==nh))
{
setClass(tw,hB?"fd_off":"fd_on");

if(!ao)
{
var _oTop=getTop(),
aZu="fOlDErsaNimaTion"+aI,
nx=_oTop[aZu];

if(!nx)
{
nx=_oTop[aZu]=new _oTop.qmAnimation(
{
from:1,
to:100
}
);
}

nx.stop();

if(hB)
{
_oContainer.style.height="1px";
show(_oContainer,true);
}
else
{
_oContainer.style.height="auto";
}

var qk=_oContainer.scrollHeight;

nx.play(
{
speed:qk,
onaction:function(ce,iz)
{
S(aI+"folders",_oTop).style.height=
(Math.floor((hB?iz:1-iz)*qk)
||1)+"px";
},
oncomplete:function(ce,akA)
{
var eb=S(aI+"folders",_oTop);
if(hB)
{
eb.style.height="auto";
}
else
{
show(eb,false);
}
}
}
);
}
else
{
show(_oContainer,hB);
}

callBack(getTop().iPadResizeFolder);
}
}
}

function decreaseFolderUnread(oG,AS,ao)
{
var lo,Pt=oG.split(';');
for(var i=Pt.length-1;i>=0;i--)
{
if(lo=KZ(0,Pt[i]))
{
KZ(1,Pt[i],lo-1,AS,ao);
}
}
}







function getFolderUnread(eI)
{
return KZ(0,eI);
}









function setFolderUnread(eI,ce,AS,ao)
{
return KZ(1,eI,ce||0,AS,ao);
}






function getGroupUnread(NZ)
{
return KZ(0,NZ,null,null,getMainWin());
}








function setGroupUnread(NZ,ce,AS)
{
return KZ(1,NZ,ce||0,AS,getMainWin());
}









function setTagUnread(eI,ce,AS,ao)
{
return KZ(1,eI,ce||0,AS,ao,true);
}











function KZ(ek,eI,ce,AS,ao,bNL)
{
var Bi=S(
[
"folder_",


(new String(eI)).toString().split("folder_").pop()
].join(""),
ao||getLeftWin()
);
if(!Bi)
{
return 0;
}

var fD=Bi.getAttribute("etitle"),
aKh=GelTags("div",Bi),
aQ=Bi.name;
if(aKh.length)
{
Bi=aKh[0];
}

var jj=typeof(ce)=="number"&&ce>0?ce:0,
acm=Bi.innerText||Bi.textContent||"",
alV=acm.lastIndexOf("("),
aFJ=alV==-1?0
:parseInt(acm.substring(alV+1,acm.lastIndexOf(")")));

if(ek==0)
{
return aFJ;
}

if(aFJ==jj)
{
return 1;
}

var aXm=jj==0,
bX={
info:htmlEncode(alV!=-1?acm.substring(0,alV):acm),
title:fD,
unread:jj
};

Bi.title=T('$title$'+(AS||aXm?'':'  \u672A\u8BFB\u90AE\u4EF6 $unread$ \u5C01')).replace(bX);




Bi=setHTML(Bi,T(aXm&&'$info$'
||(AS?'$info$($unread$)':'<b>$info$</b><b>($unread$)</b>')
).replace(bX)+(bX.info=='\u661F\u6807\u90AE\u4EF6'?'<input type="button" class="ico_input icon_folderlist_star"/>':'')+(bX.info=='\u6F02\u6D41\u74F6'?'<input class="ico_input drifticon" type="button" hidefocus />':'')
);
Bi.setAttribute("initlized","");

if(aQ&&!bNL)
{
var azE=S("folder_"+aQ,getTop());
if(azE)
{
try
{
KZ(ek,eI,jj,AS,getMainWin());
}
catch(bc)
{
doPageError(bc.message,"all.js","_optFolderUnread");
}

return setFolderUnread(azE.id,
getFolderUnread(azE.id)-aFJ+jj);
}
}

return 1;
}







function doFolderEmpty(eI,sg,oK)
{
sg.folderid.value=eI;
sg.rk.value=Math.random();

if(sg.loc)
{
sg.loc.value=oK;
}

submitToActionFrm(sg);
}







function selectAll(LB,dJ)
{
E(GelTags("input",S('list',dJ)),function(ik)
{
ik.checked=LB;
}
);
getTop().showSelectALL(dJ,LB);
}





function selectReadMail(LB,dJ)
{
E(GelTags("input",S('list',dJ)),function(ik)
{
if(ik.title!="\u9009\u4E2D/\u53D6\u6D88\u9009\u4E2D")
{
ik.checked=ik.getAttribute('unread')!=LB;
}
}
);
}





function checkAddrSelected()
{
var iY=GelTags("input"),
_nLen=iY.length,
bH;

for(var i=0;i<_nLen;i++)
{
bH=iY[i];
if(bH.type=="checkbox"&&bH.checked)
{
return true;
}
}

return false;
}






function checkBoxCount(aFC)
{
var ff=0;

E(GelTags("INPUT"),function(jH)
{
if(jH.type=="checkbox"
&&jH.name==aFC
&&jH.checked)
{
ff++;
}
}
);

return ff;
}




function PGV()
{
}






function checkCheckBoxs(aD,sg)
{
var fX=sg||S("frm",getMainWin()),
iY=GelTags("input",fX),
mv;

for(var i=0,_nLen=iY.length;i<_nLen;i++)
{
mv=iY[i];

if(mv.type=="checkbox"
&&mv.name==aD
&&mv.checked)
{
return true;
}
}

return false;
}






function setListCheck(jH,Wy)
{
if(jH.type!="checkbox")
{
return;
}

if(Wy==null)
{
Wy=jH.checked;
}
else
{
jH.checked=Wy;
}

var dD=jH.parentNode.parentNode;

if(dD.tagName=="TR")
{
dD=dD.parentNode.parentNode;
}


if(dD==S("frm",getMainWin()))
{
return;
}

var abK=dD.className;
if(abK=="B")
{
abK=Wy?"B":"";
}
else
{
abK=strReplace(abK," B","")
+(Wy?" B":"");
}

setClass(dD,abK);

if(Wy)
{
listMouseOut.call(dD);
}
}







function doCheck(_aoEvent,abn,bRG,bXG)
{
var bK=_aoEvent||window.event,
dR=abn||bK.srcElement||bK.target,
cy=bXG||getMainWin();

if(!dR||!cy)
{
return;
}

if(dR.className=="one"||dR.className=="all")
{
CA(dR);
}
setListCheck(dR);

if((bK&&bK.shiftKey||bRG)
&&cy.gCurSelObj
&&cy.gCurSelObj!=dR
&&dR.checked==cy.gCurSelObj.checked)
{
var iY=getTop().GelTags("input",cy.document),
ff=0,
_nLen=iY.length,
mv;

for(var i=0;i<_nLen;i++)
{
mv=iY[i];

if(mv.type!="checkbox")
{
continue;
}

if((mv==cy.gCurSelObj
||mv==dR)&&ff++==1)
{
break;
}

if(ff==1)
{
setListCheck(mv,dR.checked);
}
}
}
cy.gCurSelObj=dR;

getTop().showSelectALL(cy,false)
}






function checkAll(aFC,dJ)
{
E(GelTags("input",dJ),function(bt)
{
if(bt.name==aFC)
{
setListCheck(bt);
}
}
);
}







function fakeReadmail(aj)
{
QMAjax.send(
T('/cgi-bin/readmail?sid=$sid$&mailid=$mailid$&t=readsubmail&mode=fake&base=$base$&pf=$pf$').replace({
sid:getSid(),
mailid:aj.sMailId,
pf:rdVer.isPre(aj.sFolderId)?1:0,
base:rdVer("BaseVer",0)
}),
{
method:"GET",
headers:{"If-Modified-Since":"0","Cache-Control":"no-cache, max-age=0"},
onload:function(aY,bN)
{
var gE=trim2(bN);
if(aY&&gE.indexOf("(")==0)
{
var fW=evalValue(gE);
if(fW)
{
folderOpt(extend(aj,fW));
callBack(getMainWin().updatePreAndNext,[aj]);
}
}
else
{
var Dn=getActionWin().document;
Dn.open();
Dn.write(lN.responseText);
}
}
}
);
}













function folderOpt(aj)
{
if(!aj)
{
return;
}

var _oTop=getTop();
_oTop.recordCompareReadedMailId(aj.sMailId);
if(aj.bNewMail)
{
var jY=aj.sFolderId,
dSp;





if(jY>0)
{
try{
_oTop.setFolderUnread(jY,_oTop.getFolderUnread(jY)-1);
if(aj.bStar)
{
_oTop.setFolderUnread("starred",_oTop.getFolderUnread("starred")-1);
}

var ym=aj.oMatchTag||[],
i=ym.length-1;
i>=0&&setTagUnread('tag',getFolderUnread('tag')-1);
for(;i>=0;i--)
{
var gx='tag_'+ym[i];
debug(['getFolderUnread',gx,getFolderUnread(gx)]);
setTagUnread(gx,getFolderUnread(gx)-1);
}

}catch(e){}
}




}
}






function recordReadedMailId(aP)
{
getTop().gsReadedMailId=aP;
}



function recordMailListScroll()
{
getTop().gnMailListPos=bodyScroll(getTop().getMainWin(),"scrollTop");
}





function recordCompareReadedMailId(aP)
{
if(aP&&getTop().gsReadedMailId!=aP)
{
getTop().gsReadedMailId=aP;
}

QMMailCache.addData(aP,{bUnread:null});
}






function SG(aeW,caL)
{
var cP=aeW.className,
hB=!/\bsts\b/i.test(cP);



var	bH=GelTags("input",aeW.parentNode)[0],
aWN=bH&&bH.className,
aeK=(caL
?aeW.parentNode.parentNode.parentNode
:aeW.parentNode).nextSibling;

if(aWN=="one"||aWN=="all")
{
setClass(bH,hB?"one":"all");
}

setClass(aeW,
hB?cP.replace(/\bhts\b/i,"sts"):cP.replace(/\bsts\b/i,"hts"));


if(aeK.className!="toarea")
{
aeK=aeK.nextSibling;
}

if(aeK.className!="toarea")
{
return;
}

return show(aeK,hB);
}





function CA(adl)
{
if(adl)
{
var AB=(adl.className=="all"
?adl.parentNode.parentNode.parentNode.parentNode
:adl.parentNode).nextSibling;

if(AB.className!="toarea")
{
AB=AB.nextSibling;
}

if(AB.className=="toarea")
{
var bPg=adl.checked;

E(GelTags("input",AB),function(bt)
{
setListCheck(bt,bPg);
}
);
}
}
}















function RD(_aoEvent,aP,sy,ek,nc,acC,
aDD,azG,CX)
{
recordReadedMailId(aP);
recordMailListScroll();

if(_aoEvent)
{
preventDefault(_aoEvent);


var aF=_aoEvent.srcElement||_aoEvent.target,
jY=aF&&aF.getAttribute("fid");

if(jY)
{
goUrlMainFrm(T("/cgi-bin/$cgi$?sid=$sid$&folderid=$fid$&page=0&t=$t$").replace(
{
cgi:jY=="9"?"readtemplate":"mail_list",
fid:jY,
sid:getSid(),
t:jY=="9"?"sms_list_v2":""
}
),false);
return stopPropagation(_aoEvent);
}
}

var aT=rdVer.url(aP,nc,CX,
ek,getTop().bnewwin||(_aoEvent&&_aoEvent.shiftKey),
acC,aDD,azG);

rdVer.log(aP,"hit");

if(_aoEvent&&(_aoEvent.shiftKey||_aoEvent.ctrlKey||_aoEvent.metaKey))
{
var dR=_aoEvent.target||_aoEvent.srcElement;

while(dR&&dR.className!="i M"
&&dR.className!="i F")
{
dR=dR.parentNode;
}

dR&&QMReadedItem.disp(dR);
goNewWin(aT);
}
else
{
goUrlMainFrm([aT,"#stattime=",now()].join(""),false);
}
}









var QMReadedItem={};





QMReadedItem.addItem=function(ik)
{
if(!getMainWin().gMailItems)
{
getMainWin().gMailItems=[];
}

getMainWin().gMailItems.push(ik);
};





QMReadedItem.getItems=function()
{
return getMainWin().gMailItems||[];
};





QMReadedItem.save=function(bPu)
{
getMainWin().goReadedItemImg=bPu;
};





QMReadedItem.load=function()
{
return getMainWin().goReadedItemImg;
};





QMReadedItem.disp=function(amd)
{
if(!amd)
{
return;
}

var Ko=amd.type=="checkbox"
?amd.parentNode
:GelTags("input",amd)[0].parentNode,
fx=Ko.firstChild;

if(fx.tagName!="IMG")
{
insertHTML(
Ko,
"afterBegin",
T([
'<img src="$path$ico_grouplight.gif" class="showarrow"',
' title="\u8FD9\u662F\u60A8\u6700\u8FD1\u9605\u8BFB\u7684\u4E00\u5C01\u90AE\u4EF6" />'
]).replace(
{
path:getPath("image")
}
)
);
fx=Ko.firstChild;
}

show(this.load(),false);
show(fx,true);

this.save(fx);
};





QMReadedItem.read=function(abn)
{
if(abn&&abn.tagName==="U")
{
fireMouseEvent(abn,"click");
}
else
{
if(!this.load())
{
return false;
}

fireMouseEvent(
GelTags("table",this.load().parentNode.parentNode)[0].parentNode,
"click"
);
}

return true;
};






QMReadedItem.check=function(cbf)
{
if(!this.load())
{
return false;
}

var azC=this.load().nextSibling;
azC.checked=!azC.checked;

doCheck(null,azC,cbf);
return true;
};






QMReadedItem.move=function(cbi)
{
var bv=this.getItems(),
aCX=bv.length,
ec=-1;

if(aCX==0)
{
return false;
}

if(this.load()!=null)
{
var bZY=QMReadedItem.load().nextSibling;

for(var i=aCX-1;i>=0;i--)
{
if(bZY==bv[i])
{
ec=i;
break;
}
}
}

ec+=cbi?1:-1;

if(ec>-1&&ec<aCX)
{
this.disp(bv[ec]);
scrollIntoMidView(bv[ec],getMainWin().document.body,false);
return true;
}

return false;
};







function listMouseOver(_aoEvent)
{
var ae=this,
cP=ae.className;

if(cP.indexOf(" B")==-1
&&cP.indexOf(" V")==-1
&&ae.getAttribute("colorchange")!="none")
{
ae.className=cP+" V";
}


if(_aoEvent)
{
var aF=getEventTarget(_aoEvent);
while(aF&&aF!=ae&&aF.className!='tagbgSpan')
{
aF=aF.parentNode;
}
if(aF&&aF!=ae)
{
QMTag.showTagClose(aF,1);
}
}
}





function listMouseOut(_aoEvent)
{
var ae=this;
if((!_aoEvent||!isObjContainTarget(ae,_aoEvent.relatedTarget
||_aoEvent.toElement))
&&ae.className.indexOf(" V")>-1
&&ae.getAttribute("colorchange")!="none")
{
ae.className=ae.className.replace(" V","");
}


if(_aoEvent)
{

var aF=getEventTarget(_aoEvent);
while(aF&&aF!=ae&&aF.className!='tagbgSpan')
{
aF=aF.parentNode;
}
if(aF&&aF!=ae)
{
QMTag.showTagClose(aF,0);
}
}

}






function listMouseEvent(bz)
{
addEvents(bz,{
contextmenu:function(_aoEvent)
{
listContextMenu.call(bz,_aoEvent);
},
mouseover:function(_aoEvent)
{
listMouseOver.call(bz,_aoEvent);
},
mouseout:function(_aoEvent)
{
listMouseOut.call(bz,_aoEvent);
}
});
}

function listContextMenu(_aoEvent)
{
var _oDom=this;
allDeferOK()&&mailRightMenu(_oDom,_aoEvent);
preventDefault(_aoEvent);
}





function GetListMouseClick(ao)
{
return function(_aoEvent)
{
ListMouseClick(_aoEvent,ao||window);
}
}






function ListMouseClick(_aoEvent,ao)
{
var dR,
bK=_aoEvent||ao.event;

if(!(dR=getEventTarget(bK)))
{
return;
}


if(attr(dR,"name")=="mailid"||(dR.lastChild&&attr(dR.lastChild,"name")=="mailid"))
{
if(dR.lastChild&&attr(dR.lastChild,"name")=="mailid")
{
dR.lastChild.click();
}

if(!getGlobalVarValue('TIP_46'))
{
requestShowTip('gotnomail',46,ao,function(bN,fP)
{



setGlobalVarValue('TIP_46',1);

return true;
}
);
}

return doCheck(bK);
}


if(dR.className.indexOf("cir")==0)
{
var Uw=GelTags("table",dR.parentNode.parentNode)[0]
.parentNode.onclick.toString().split("{")[1]
.split("}")[0].replace(/event/ig,"{shiftKey:true}");

if(/\WRD/.test(Uw))
{
return eval(Uw);
}
else
{
Uw=GelTags("table",dR.parentNode.parentNode)[0]
.parentNode.onclick.toString().replace(/.*{/g,"")
.replace(/}.*/g,"").replace(/event/ig,"{shiftKey:true}");
return eval(Uw);
}
}
}






function listInitForComm(cX,bLH)
{
var cP,
qs=GelTags("div"),
bIY=doCheck,
Vq,oN;

cP=cX?cX:"M";
for(var i=qs.length-1;i>=0;i--)
{
Vq=qs[i];

if(Vq.className!=cP)
{
continue;
}

if(cX=="ft")
{
Vq=GelTags("table",Vq)[0];
}

oN=GelTags("input",Vq)[0];
if(!oN||oN.type!="checkbox")
{
continue;
}

oN.title="\u6309\u4F4Fshift\u70B9\u51FB\u4E0D\u540C\u7684\u52FE\u9009\u6846 \u53EF\u65B9\u4FBF\u5FEB\u6377\u591A\u9009";
addEvent(oN,"click",bIY);









if(!bLH)
{
listMouseEvent(Vq);
}
}
}










function modifyFolder(nc,DF)
{
getMainWin().location.href=T([
'/cgi-bin/foldermgr?sid=$sid$&fun=detailpop&t=pop_detail',
'&folderid=$folderid$&acctid=$acctid$'
]).replace(
{
sid:getSid(),
folderid:nc,
acctid:DF
}
);
return false;
}







function recvPopHidden(nc)
{
getMainWin().setTimeout(
function()
{
if(!nc)
{
getTop().reloadFrmLeftMain(false,true);
}
else
{
var aU="iframeRecvPopHidden";
createBlankIframe(getMainWin(),{id:aU});

var aT=["/cgi-bin/mail_list?sid=",getSid(),"&folderid=",
nc,"&t=recv_pop_hidden"].join("");
try
{
F(aU,getMainWin()).location.replace(aT);
}
catch(bc)
{
S(aU,getMainWin()).src=aT;
}
}
},
10000
);
}






function recvPop(DF,nc,dJ)
{
recvPopCreat(DF,nc);
if(S("tips",dJ))
{
S("tips",dJ).innerHTML=T(
[
'<img src="$images_path$ico_loading30aa5d9.gif" align=absmiddle>',
' \u6B63\u5728\u6536\u53D6...&nbsp;\u7CFB\u7EDF\u5C06\u5728\u540E\u53F0\u81EA\u52A8\u6536\u53D6\uFF0C\u60A8\u53EF\u4EE5\u79BB\u5F00\u6B64\u9875\u9762\uFF0C\u7A0D\u540E\u56DE\u6765\u67E5\u770B\u6536\u53D6\u7ED3\u679C\u3002'
]
).replace(
{
images_path:getPath("image",true)
}
);
}


recvPopHidden(nc);
}





function recvPopCreat(DF)
{
getActionWin().location=["/cgi-bin/foldermgr?sid=",getSid(),
"&fun=recvpop&acctid=",DF].join("");
}




function recvPopAll()
{
getActionWin().location=["/cgi-bin/foldermgr?sid=",getSid(),
"&fun=recvpopall"].join("");
try
{

setTimeout(
function()
{
reloadFrmLeftMain(false,true);
},
3000
);
}
catch(bc)
{
}
return false;
}









function setPopFlag(DF,HU,bJ)
{
if(HU=="recent")
{
setPopRecentFlag(DF,bJ);
}
}






function setPopRecentFlag(DF,bJ)
{
runUrlWithSid(["/cgi-bin/foldermgr?sid=",getSid(),
"&fun=pop_setting&acctid=",DF,"&recentflag=",bJ].join(""));
}







function checkPopMailShow(oG)
{
var aVx=["@yahoo.com.cn","@sina.com","@tom.com","@gmail.com"],
bRl=oG.toLowerCase();

for(var i=0;i<aVx.length;i++)
{
if(bRl.indexOf(aVx[i])>=0)
{
return true;
}
}

return false;
}









function setBeforeUnloadCheck(ao,_asMsg,QP,cdy,
eW)
{
var aDX=["input","select","textarea"];

ao=ao||window;
eW=eW?(typeof(eW)=="string"
?S(eW,ao)
:eW):ao.document;
ao.gbIsBeforeUnloadCheck=true;

E(aDX,
function(jE)
{
var ced=ao[jE+"_save"]=[];

E(GelTags(jE,eW),
function(bz,dk)
{
ced.push(bz.value+bz.checked);
bz.setAttribute("saveid",dk);
}
);
}
);

if(!ao.onsetbeforeunloadcheck)
{
ao.onsetbeforeunloadcheck=function()
{
if(ao.gbIsBeforeUnloadCheck)
{
for(var i=0,_nLen=aDX.length;i<_nLen;i++)
{
var Cn=aDX[i],
aQ=Cn+"_save",
acV=GelTags(Cn,eW);

for(var j=0,jlen=acV.length;j<jlen;j++)
{
var aZp=acV[j].getAttribute("saveid");
if(aZp!=null&&acV[j].getAttribute("nocheck")!="true"&&ao[aQ][aZp]
!=(acV[j].value+acV[j].checked))
{
return _asMsg?_asMsg:"\u60A8\u4FEE\u6539\u7684\u8BBE\u7F6E\u5C1A\u672A\u4FDD\u5B58\uFF0C\u786E\u5B9A\u8981\u79BB\u5F00\u5417\uFF1F";
}
}
}
}
};

gbIsIE?(ao.document.body.onbeforeunload=ao.onsetbeforeunloadcheck)
:ao.document.body.setAttribute("onbeforeunload","return onsetbeforeunloadcheck();");
}

E(cdy||["cancel"],
function(aEJ)
{
addEvent(
typeof(aEJ)=="string"
?S(aEJ,ao):aEJ,
"mousedown",
function()
{
ao.gbIsBeforeUnloadCheck=false;
}
);
}
);

E(GelTags("form",ao.document),
function(mf)
{
addEvent(mf,"submit",
function()
{
ao.gbIsBeforeUnloadCheck=false;
}
);

if(!mf.Qg)
{
mf.Qg=mf.submit;
mf.submit=function()
{
ao.gbIsBeforeUnloadCheck=false;
this.Qg();
};
}
}
);
}









function popErrProcess(_asMsg,Xs,aoe,DC,bVh,bdX)
{
if(_asMsg!=null)
{
msgBox(_asMsg,Xs,aoe,DC);
}

if(bdX!=null)
{
getMainWin().ShowPopErr(bdX,bVh);
}

showSubmitBtn();
}




function showSubmitBtn()
{
var Ga=S("submitbtn",getMainWin());

if(Ga)
{
Ga.disabled=false;
}
}




function showPopSvr()
{
show(S("popsvrTR",getMainWin()),true);
}





function setTaskId(yF)
{
try
{
getMainWin().document.checkFrom.taskid.value=yF;
}
catch(bc)
{
}
}








function showQuickReply(nh)
{
show(S('quickreply',getMainWin()),nh);
show(S('upreply',getMainWin()),!nh);
runUrlWithSid("/cgi-bin/getcomposedata?Fun=setshowquickreply&isShowQuickReply="
+(nh?0:1));
}




function hiddenReceipt(ao)
{
show(S("receiptDiv",ao),false);
}





function switchOption(dJ)
{
var aE=[
[
"<input type='button' class='qm_ico_quickup' title='\u9690\u85CF' />",true],
[
"<input type='button' class='qm_ico_quickdown' title='\u663E\u793A\u66F4\u591A\u64CD\u4F5C' />",false]
][
S("trOption",dJ).style.display=="none"?0:1
];
S("aSwitchOption",dJ).innerHTML=aE[0];
show(S("trOption",dJ),aE[1]);
}






function checkPerDel(ao)
{


delMail("PerDel",ao);

}






function delMail(aaD,ao)
{
rmMail(aaD=="PerDel"?1:0,ao.QMReadMail.getCBInfo(ao));
}








function setMailType(av,EU,Ks,dJ)
{
var fX=S("mail_frm",dJ);

fX.s.value=["readmail_",
EU?(Ks?"group":av):("not"+av),
getMainWin().newwinflag?"_newwin":""].join("");
fX.action="/cgi-bin/mail_mgr?sid="+getSid();
fX.mailaction.value="mail_spam";
fX.isspam.value=EU;
fX.reporttype.value=av=="cheat"?"1":"";

submitToActionFrm(fX);
}



function getAddrSub(addr)
{
var _oPos=addr.indexOf("@");
if(_oPos>-1)
{
var addrName=addr.substr(0,_oPos);
var addrDom=addr.substr(_oPos);
return subAsiiStr(addrName,18,'...')+subAsiiStr(addrDom,18,'...');
}
else
{
debug("name+dom"+addr);
return subAsiiStr(addr,36,'...');
}
}

function getRefuseText(Mg)
{
var aYq=T([
'<input type="checkbox" name="$TNAME$" id="$TID$" $TCHECK$>\u5C06<label for="$TID$">$TVALUE$</label>\u52A0\u5165\u9ED1\u540D\u5355'
]);
var i;
var retstr="";
var br="";
for(i in Mg)
{
var tagname="refuse";
if(i>0){
tagname="refuse"+i;
br="<br>"
}
var addrlabel;
if(Mg[i]!="\u53D1\u4EF6\u4EBA")
addrlabel="&lt;"+getAddrSub(Mg[i])+"&gt;";
else
addrlabel=Mg[i];
var ischecked="";
debug("ITEM: "+Mg[i]);
retstr+=br+aYq.replace({
TNAME:tagname,
TID:tagname,
TVALUE:addrlabel,
TCHECK:ischecked
});
}
debug("RET Text"+retstr);
return retstr;
}










function reportSpam(alT,aDU,ao,zm,Jv)
{
debug("Enter mail.js reportSpam "+alT);
var az=ao||(window==getTopWin()?getMainWin():window);
if(!S("mail_frm",az))
{
debug("enter from maillist");

var jC=QMMailList.getCBInfo(az),
_oInfo,
aZs=0,
cj=jC.oMail.length,
tM={};
if(cj==0)
{
showError(gsMsgNoMail);
return false;
}
for(var aK=0;aK<cj;aK++)
{

_oInfo=jC.oMail[aK];
if(_oInfo.bSys)
{





}
aZs+=_oInfo.bDft?1:0;
if(_oInfo.sSEmail.indexOf("@groupmail.qq.com")!=-1)
{

alT=true;
}else if(_oInfo.sSEmail.indexOf("10000@qq.com")!=-1){

alT=true;
}
if(typeof tM.sender=="undefined")
{
tM.sender=_oInfo.sSEmail;
tM.nickname=_oInfo.sSName;
}else if(tM.sender!=_oInfo.sSEmail)
{
tM.sender="";
}
}
if(aZs==cj)
{

zm=1;
}
else
{

for(aK=0;aK<cj;aK++)
{
_oInfo=jC.oMail[aK];




}
jC=QMMailList.getCBInfo(az);
QMMailList.selectedUI(jC);
}
}

var Nz=new Array();
Nz[0]="\u53D1\u4EF6\u4EBA";

if(tM&&tM.sender&&tM.sender.indexOf(',')<0)
{
Nz[0]=tM.sender;
}

var ats=0;
if(Jv)
{
if(Jv[0].length>0)Nz[ats++]=Jv[0];
if(Jv[1])Nz[ats++]=Jv[1];
}
var acy=T([
'<div>',
'<input type="radio" name="reporttype" id="r$value$" value="$value$" $checked$>',
'<label for="r$value$">$content$</label>',
'</div>'
]);
var cq=(zm!==1?[
"<div style='padding:10px 10px 0 25px;text-align:left;'>",
"<form id='frm_spamtype'>",
"<div style='margin:3px 0 3px 3px'><b>\u8BF7\u9009\u62E9\u8981\u4E3E\u62A5\u7684\u5783\u573E\u7C7B\u578B\uFF1A</b></div>",
acy.replace({
value:(aDU?11:8),
checked:"checked",
content:"\u5176\u4ED6\u90AE\u4EF6"
}),

acy.replace({
value:(aDU?10:4),
checked:"",
content:"\u5E7F\u544A\u90AE\u4EF6"
}),

acy.replace({
value:(aDU?9:1),
checked:"",
content:"\u6B3A\u8BC8\u90AE\u4EF6"
}),
"<div style=\"padding:5px 0 2px 0;\">",
(alT
?"&nbsp;"
:getRefuseText(Nz)),"</div><div style='margin:10px 3px 0px 3px' class='addrtitle' >\u6E29\u99A8\u63D0\u793A\uFF1A\u6211\u4EEC\u5C06\u4F18\u5148\u91C7\u7EB3\u51C6\u786E\u5206\u7C7B\u7684\u4E3E\u62A5\u90AE\u4EF6\u3002</div>","</form>",
"</div><div style='padding:3px 15px 12px 10px;text-align:right;'>",
"<input type=button id='btn_ok' class='btn wd2' value=\u786E\u5B9A>",
"<input type=button id='btn_cancel' class='btn wd2' value=\u53D6\u6D88>",
"</div>"
]:[
"<div class='cnfx_content'>",
"<img style='float:left; margin:5px 10px 0;' src='",getPath("image"),"ico_question.gif' />",
"<div class='b_size' style='padding:10px 10px 0 0;margin-left:65px;line-height:1.5;height:80px;text-align:left;'>",
"<form id='frm_spamtype'>",
"<strong>\u60A8\u8981\u4E3E\u62A5\u8FD9\u4E2A\u6F02\u6D41\u74F6\u5417\uFF1F</strong><br>",
"<div style=\"display:none\">",
acy.replace({
value:8,
checked:"checked",
content:""
}),
"</div>",
"\u4E3E\u62A5\u4EE5\u540E\uFF0C\u60A8\u5C06\u4E0D\u518D\u6536\u5230\u8FD9\u4E2A\u6F02\u6D41\u74F6\u7684\u56DE\u5E94\u3002","</form>",
"</div></div><div class='cnfx_btn'>",
"<input type=button id='btn_ok' class='btn wd2' value=\u786E\u5B9A>",
"<input type=button id='btn_cancel' class='btn wd2' style='margin-left:5px' value=\u53D6\u6D88>",
"</div>"
]).join("");

new(getTop().QMDialog)({
sId:"reportSpam",
sTitle:zm===1?"\u7838\u6389\u8FD9\u4E2A\u74F6\u5B50":"\u4E3E\u62A5\u5E76\u62D2\u6536\u9009\u4E2D\u90AE\u4EF6",
sBodyHtml:cq,
nWidth:450,
nHeight:zm===1?150:220,
onload:function(){
var bM=this;
addEvent(bM.S("btn_ok"),"click",function()
{
var fX=S("mail_frm",getMainWin())||S("frm",getMainWin());
if(!fX)
{
return;
}
fX.s.value="readmail_spam";
fX.isspam.value='true';
fX.mailaction.value="mail_spam";
fX.action='/cgi-bin/mail_mgr?sid='+getTop().getSid();

var ala=bM.S("frm_spamtype").reporttype,
Uo=bM.S("frm_spamtype").refuse,
Xi=bM.S("frm_spamtype").refuse1;
for(var i=0,_nLen=ala.length;i<_nLen;i++)
{
if(ala[i].checked)
{
fX.reporttype.value=ala[i].value;
break;
}
}
var wU=new Array();
wU[0]="0";
wU[1]="0";
if((Uo&&Uo.checked)||
(Xi&&Xi.checked))
{
fX.s.value="readmail_reject";
}

if(Xi)
{
wU[0]=Uo&&Uo.checked?"1":"0";
wU[1]=Xi.checked?"1":"0";
}
else 
{
wU[0]="1";
wU[1]="1";
}

if(fX.s_reject_what){
fX.s_reject_what.value=wU[0]+wU[1];
debug("Reject method "+fX.s_reject_what.value);
}

submitToActionFrm(fX);
bM.close();
});
addEvent(bM.S("btn_cancel"),"click",function(){bM.close()});

},
onshow:function()
{
this.S("btn_cancel").focus();
}
});

return false;
}









function setSpamMail(EU,Ks,dJ)
{
var bem=dJ||(window==getTopWin()?getMainWin():window);
if(EU&&!Ks)
{
return reportSpam(null,null,bem);
}
setMailType("spam",EU,Ks,bem);
}






function setCheatMail(EU,Ks)
{
setMailType("cheat",EU,Ks);
}






function doReject(EU,Ks,dJ,fN)
{
var bbC="\u6B64\u90AE\u4EF6\u5730\u5740";
if(fN){
bbC="<"+fN+">";
}

var fX=S("mail_frm",dJ);
if(fX.s_reject_what)
{
fX.s_reject_what.value="10";
}

if(confirm("\u7CFB\u7EDF\u4F1A\u628A"+bbC+"\u653E\u5165\u201C\u9ED1\u540D\u5355\u201D\u4E2D\uFF0C\u60A8\u5C06\u4E0D\u518D\u6536\u5230\u6765\u81EA\u6B64\u5730\u5740\u7684\u90AE\u4EF6\u3002\n\n\u786E\u5B9A\u8981\u62D2\u6536\u6B64\u53D1\u4EF6\u4EBA\u7684\u90AE\u4EF6\u5417\uFF1F"))
{
setMailType("reject",EU,Ks,dJ);
}
}




function setFolderReaded(eI,NZ,cRk,bPy)
{

var bPT=eI=="all"?parseInt(bPy||"0"):(NZ?getGroupUnread(NZ):getFolderUnread(eI));
if(bPT<1)
{
return showError("\u6587\u4EF6\u5939\u5185\u6CA1\u6709\u672A\u8BFB\u90AE\u4EF6");
}

var jD=getSid(),
aZo=unikey("allread"),
bmH=function()
{
QMAjax.send("/cgi-bin/mail_mgr?mailaction=read_all&t=unreadmail_reg_data&loc=setFolderUnread,,,32",
{
method:"POST",
content:T('sid=$sid$&folderid=$folderid$&groupid=$groupid$').replace(
{
sid:jD,
folderid:eI!="all"?eI:"1&folderid=3&folderid=8&folderid=9&folderid=11&folderid=personal&folderid=pop&folderid=subscribe",
groupid:NZ
}
),
onload:function(aY,bN)
{
if(aY&&bN.indexOf("mark_allmail_ok")>-1)
{
var fl="\u6587\u4EF6\u5939\u6807\u4E3A\u5DF2\u8BFB\u64CD\u4F5C"
reloadFrmLeftMain(true,!!getMainWin()[aZo]);
showInfo(fl+"\u6210\u529F");
var aE=eval(bN);
setRollBack(aE.rbkey,fl);
}
else
{
showError("\u6587\u4EF6\u5939\u6807\u4E3A\u5DF2\u8BFB\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
}
}
});
};
getMainWin()[aZo]=1;


bmH();












































}






function linkMaker(Ox)
{


var dVa="(https?:\\/\\/[\\w.]+[^ \\f\\n\\r\\t\\v\"\\\\\\'\\<\\>\[\\]\\u2100-\\uFFFF]*)",






bSW="([a-z0-9.!#$%&'*+/=?^_`{|}~-]+@(?:[A-Z0-9-]+\\.)+[A-Z]{2,4})";
function aCT(bG)
{
var ij=12,
fG=bG||"",
_oList=[],
_nLen=fG.length/ij;

for(var i=0;i<_nLen;i++)
{
_oList[i]=fG.substr(i*ij,ij);
}

return _oList.join("<wbr>");
}

return Ox.replace(
new RegExp([dVa,bSW].join("|"),"ig"),
function(biJ,dIv,azU)
{
if(azU)
{
return['<a href="mailto:',azU,'">',
aCT(azU),'</a>'].join("");
}
else
{
return['<a href="',biJ,'">',
aCT(biJ),'</a>'].join("");
}
}
);
}





function linkIdentify(bz)
{
if(!bz||bz.tagName=="A"||bz.tagName=="SCRIPT"
||bz.tagName=="STYLE"||bz.className=="qqmailbgattach")
{
return;
}

for(var cD=bz.firstChild,nextNode;cD;cD=nextNode)
{
nextNode=cD.nextSibling;
linkIdentify(cD);
}

if(bz.nodeType==3)
{
var fG=bz.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;"),
iw=linkMaker(fG);

if(fG!=iw)
{
var jb=false;

if(bz.previousSibling)
{
jb=insertHTML(bz.previousSibling,"afterEnd",iw);
}
else
{
jb=insertHTML(bz.parentNode,"afterBegin",iw);
}

if(jb)
{
removeSelf(bz);
}
}
}
}







function bhU(_aoDom)
{
var fQ=_aoDom.href||"",
ez=_aoDom.ownerDocument,
jw=(ez.parentWindow||ez.defaultView).location;
return!_aoDom.onclick&&fQ&&fQ.indexOf("javascript:")!=0&&fQ.indexOf("#")!=0&&
fQ.indexOf(jw.protocol+"//"+jw.hostname+"/")!=0;

}







function swapLink(aI,NY,dJ)
{
var dD=aI.ownerDocument?aI:S(aI,dJ);
if(dD)
{
function aNs(asM)
{
if(bhU(asM))
{
asM.target="_blank";
asM.onclick=function()
{
return aUN.call(this,NY);
};
}
asM=null;
}

linkIdentify(dD);
E(GelTags("a",dD),aNs);
E(GelTags("area",dD),aNs);
E(GelTags("form",dD),function(bjw)
{
bjw.onsubmit=function()
{
var jw=dJ.location;

if(jw.getParams()["filterflag"]=="true"||this.action)
{
this.target="_blank";
return true;
}

showError(T(['\u51FA\u4E8E\u5B89\u5168\u8003\u8651\u8BE5\u64CD\u4F5C\u5DF2\u88AB\u5C4F\u853D [<a onclick="',
'setTimeout( function() {',
'goUrlMainFrm(\x27$url$&filterflag=true\x27);',
'showInfo(\x27\u53D6\u6D88\u5C4F\u853D\u6210\u529F\x27);','});',
'" style="color:white;" >\u53D6\u6D88\u5C4F\u853D</a>]']).replace({url:jw.pathname+jw.search}));

return false;
};
bjw=null;
}
);
}
dD=null;
}






function preSwapLink(_aoEvent,NY)
{
var aF=getEventTarget(_aoEvent);
if(aF
&&{"A":1,"AREA":1}[aF.tagName]
&&bhU(aF))
{
aUN.call(aF,NY)&&window.open(aF.href);
preventDefault(_aoEvent);
}
}








function swapImg(aI,dWx,NY,ao)
{














































































}




function openSpam(ao)
{
ao=ao||window;
if(true||confirm("\u6B64\u90AE\u4EF6\u7684\u56FE\u7247\u53EF\u80FD\u5305\u542B\u4E0D\u5B89\u5168\u4FE1\u606F\uFF0C\u662F\u5426\u67E5\u770B\uFF1F"))
{
ao.location.replace(appendToUrl(ao.location.href,"&disptype=html&dispimg=1&clickshowimage=1"));
}
}




function openHttpsMail(ao)
{
ao.location.replace(appendToUrl(ao.location.href,"&dispimg=1"));
}






function copyToClipboard(fm)
{
try
{
if(gbIsFF)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper).copyString(fm);
}
else
{

var Jz=S("copyinputcontainer");
if(!Jz)
{
insertHTML(document.body,"beforeEnd",'<input id="copyinputcontainer" style="position:absolute;top:-1000px;left:-1000px;"/>');
Jz=S("copyinputcontainer");
}
Jz.value=fm;
Jz.select();
document.execCommand('Copy');
}
}
catch(e)
{
alert(T('\u60A8\u7684\u6D4F\u89C8\u5668\u5B89\u5168\u8BBE\u7F6E\u4E0D\u5141\u8BB8\u7F16\u8F91\u5668\u81EA\u52A8\u6267\u884C\u590D\u5236\u64CD\u4F5C\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u5FEB\u6377\u952E($cmd$+C)\u6765\u5B8C\u6210\u3002').replace({cmd:gbIsMac?"Command":"Ctrl"}));
return false;
}
return true;
}






function aUN(NY)
{
var eS=this;

if(eS.href.indexOf("mailto:")==0&&eS.href.indexOf("@")!=-1)
{
window.open(["/cgi-bin/readtemplate?sid=",getSid(),
"&t=compose&s=cliwrite&newwin=true&email=",
eS.href.split("mailto:")[1]].join(""));
return false;
}
else if(eS.className=="qqmail_card_reply"
||eS.className=="qqmail_card_reply_btn"
||eS.className=="qqmail_birthcard_reply"
||eS.className=="qqmail_birthcard_reply_btn")
{






var fD=eS.name,
cP=eS.className,
aLl=!!fD,
bYq=cP.indexOf("birthcard")!=-1;

getMainWin().location=T('/cgi-bin/cardlist?sid=$sid$&t=$t$&s=$s$&today_tips=$tips$&loc=readmail,readmail,sendnewcard,1&ListType=$listtype$&email=$email$$newwin$').replace(
{
sid:getSid(),
t:aLl?"compose_card":"card",
s:bYq?"replybirthcard":"",
tips:cP.indexOf("btn")!=-1?"112":"111",
listtype:aLl?"No":"Cards&Cate1Idx=listall",
email:fD,
newwin:getTop().bnewwin?"&newwin=true":""
});
return false;
}
else if(eS.className=="qqmail_postcard_reply_mobile")
{
var wp=getMainWin().QMReadMail;
if(wp)
{
getMainWin().location=T("/cgi-bin/readmail?sid=$sid$&mailid=$mailid$&t=compose&s=reply&disptype=html").replace(
{
sid:getSid(),
mailid:wp.getMailId()
})
}
return false;
}
else if(eS.className=="qqmail_postcard_sendhelp_mobile")
{
window.open("http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=36&&no=1000696");
return false;
}
else if(eS.className=="qqmail_card_reply_thanksbtn"
||eS.className=="qqmail_card_reply_thanks"
||eS.className=="qqmail_birthcard_reply_thanksbtn")
{
var fD=eS.name;

openComposeDlg("card",{
sTitle:"\u7B54\u8C22\u597D\u53CB",
sDefAddrs:fD,
bAddrEdit:true,
sDefContent:"\u8C22\u8C22\u4F60\u7684\u8D3A\u5361\uFF01 \u4EE5\u540E\u8981\u5E38\u8054\u7CFB\u54E6\u3002",
bContentEdit:true,
sDefSubject:"\u8C22\u8C22\u4F60\u7684\u8D3A\u5361!",
bRichEditor:false,
oncomplete:function(){},

bShowResult:true
});
return false;
}












else if(eS.className=="qqmail_postcard_reply")
{
goUrlMainFrm(
T('/cgi-bin/readtemplate?sid=$sid$&t=compose_postcard&email=$email$'
).replace({
sid:getSid(),
email:eS.name
}),false
);
return false;
}
else if(eS.className=="qqmail_postcard_reply2")
{
var biw='',
aGU='',
wp=getMainWin().QMReadMail;
if(wp)
{
try
{
var Yp=(wp.getSubMailWithDom?wp.getSubMailWithDom(eS):wp.getMailInfo()).from;
biw=Yp&&Yp.name||'';
aGU=Yp&&Yp.addr||'';
}
catch(e)
{
}
}
goUrlMainFrm(
T('/cgi-bin/readtemplate?sid=$sid$&t=compose_postcard&email=$email$&reply=1&frname=$name$&fraddr=$addr$'
).replace({
name:escape(biw),
addr:escape(aGU),
sid:getSid(),
email:eS.name
}),false
);
return false;
}












else if(eS.className=="qqmail_postcard_print")
{
var wp=getMainWin().QMReadMail;
if(wp)
{
window.open(T('/cgi-bin/readmail?sid=$sid$&t=print_haagendazs&s=print&filterflag=true&mailid=$mailid$').replace(
{
sid:getSid(),
mailid:wp.getMailId()
})
);
}
return false;
}
else if(eS.className=="qqmail_postcard_getmoreinfo")
{
var wp=getMainWin().QMReadMail;
if(wp)
{
window.open(T('/cgi-bin/today?t=haagendazs2010&sid=$sid$').replace(
{
sid:getSid(),
mailid:wp.getMailId()
})
);
}
return false;
}
else if(eS.className=="qqmail_videomail_reply")
{
goUrlMainFrm(
T('/cgi-bin/readtemplate?sid=$sid$&t=compose_video&email=$email$'
).replace({
sid:getSid(),
email:eS.name
}),false
);
return false;
}
else if(eS.className=="groupmail_open")
{
getMainWin().location=["/cgi-bin/grouplist?sid=",getSid(),
"&t=compose_group",(getTop().bnewwin?"&newwin=true":"")].join("");
return false;
}
else if(eS.className=="reg_alias")
{
getMainWin().location=[
"/cgi-bin/readtemplate?reg_step=1&t=regalias_announce&sid=",
getSid()].join("");
return false;
}

else if(eS.className=="mergemail_reader_article_list_link")
{
var bJt=eS.getAttribute("ctype");
var aBV=eS.getAttribute("param_new");
var aT="";


if(aBV.indexOf("follow=1")>=0)
{
var bUa=eS.getAttribute("followuin");
aT=(getTop().gsRssDomain||"")+"/cgi-bin/reader_mgr";
QMAjax.send(aT,
{
method:"POST",
content:"fun=followshare&followuin="+bUa+"&sid="+getSid(),
onload:function(aY,cAd)
{
if(aY)
{

getMainWin().location=T('$host$/cgi-bin/reader_article_list?sid=$sid$&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:aBV
});
}
}
});
}

else
{
getMainWin().location=T('$host$/cgi-bin/reader_article_list?sid=$sid$&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:aBV
});
}


if(bJt=="onefeed")
{
aT=(getTop().gsRssDomain||"")+"/cgi-bin/reader_mgr?fun=setlog&flag=3&from=2";
}
else
{
aT=(getTop().gsRssDomain||"")+"/cgi-bin/reader_mgr?fun=setlog&flag=3&from=4";
}
runUrlWithSid(aT);

return false;
}
else if(eS.className=="mergemail_reader_setting_link")
{

getMainWin().location=T('$host$/cgi-bin/reader_setting?t=rss_setting_notify&sid=$sid$&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:eS.getAttribute("param")
});


var aT=(getTop().gsRssDomain||"")+"/cgi-bin/reader_mgr?fun=setlog&flag=3&from=3";
runUrlWithSid(aT);
return false;
}
else if(eS.className=="reader_article_list_link")
{

getMainWin().location=T('$host$/cgi-bin/reader_article_list?sid=$sid$&$param$').replace(
{
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:eS.getAttribute("param")
}
);

return false;
}

else if(eS.className=="reader_detail_qqmail_link")
{
var dp=[];

E(eS.getAttribute("param").split("&"),function(bN)
{
if(bN.indexOf("share=1")<0)
{
dp.push(bN);
}
}
);

getMainWin().location=T('$host$/cgi-bin/reader_detail?sid=$sid$&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:dp.join("&")
});
return false;
}
else if(eS.className=="reader_list_qqmail_link")
{
var dp=[];

E(eS.getAttribute("param").split("&"),function(bN)
{
dp.push(bN);
}
);
getMainWin().location=T('$host$/cgi-bin/reader_list?classtype=allfriend&refresh=1&share=1&sid=$sid$&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:dp.join("&")
});
return false;
}
else if(eS.className=="reader_catalog_list_qqmail_link")
{
var dp=[];

E(eS.getAttribute("param").split("&"),function(bN)
{
dp.push(bN);
}
);

getMainWin().location=T('$host$/cgi-bin/reader_catalog_list?sid=$sid$&classtype=share&share=1&refresh=1&$param$'
).replace({
host:(getTop().gsRssDomain||""),
sid:getSid(),
param:dp.join("&")
});
return false;
}
else if(eS.className=="ftn_groupshare_enter_link")
{
getMainWin().location.href=T(
'/cgi-bin/ftnExs_files?listtype=group&s=group&t=exs_ftn_files&sid=$sid$'
).replace({sid:getSid()});
return false;
}
else if(eS.className=="book_article_list_link")
{

getMainWin().location=T('/cgi-bin/setting10?sid=$sid$&$param$').replace(
{
sid:getSid(),
param:eS.getAttribute("param")
}
);

return false;
}



if(1)
{

if(eS.href.indexOf("javascript:void(0)")>=0)
{

return false;
}
if(NY!="preview"&&getMainWin().location.href.indexOf('/cgi-bin/readmail?')<0)
{
return true;
}

var ks=eS.parentNode;
while(ks)
{
if(ks.nodeType==1&&(ks.id=="QQmailNormalAtt"||ks.id=="attachment"))
{
return true;
}
ks=ks.parentNode;
}

window.open(T('/cgi-bin/mail_spam?sid=$sid$&action=check_link&url=$url$&mailid=$mid$&spam=$spam$').replace(
{
mid:getMainWin().location.getParams()['mailid'],
spam:NY=="spam"?1:0,
sid:getSid(),
url:escape(eS.href)
}
),"_blank");
return false;
}

var fG="http://mail.qq.com/cgi-bin/feed?u=";
if(eS.name=="_QQMAIL_QZONESIGN_"||eS.href.indexOf(fG)==0)
{
if(eS.name=="_QQMAIL_QZONESIGN_")
{
var bIy=eS.href.split("/"),
nS=parseInt(bIy[2]),
bX=[
"&sid=",
getSid(),
"&u=http%3A%2F%2Ffeeds.qzone.qq.com%2Fcgi-bin%2Fcgi_rss_out%3Fuin%3D",
nS
].join("");
}
else
{
var aTQ=eS.href.substr(fG.length);
if(aTQ.indexOf("http%3A%2F%2F")==0
||aTQ.indexOf("https%3A%2F%2F")==0)
{
var bX=["&sid=",getSid(),"&u=",eS.href.substr(fG.length)]
.join("");
}
else
{
var bX=["&sid=",getSid(),"&u=",
encodeURIComponent(eS.href.substr(fG.length))].join("");
}
}
if(getTop().bnewwin)
{
goUrlTopWin(["/cgi-bin/frame_html?target=feed",bX].join(""));
}
else
{
goUrlMainFrm(["/cgi-bin/feed?",bX].join(""),false);
}
return false;
}
else if(eS.name=="QmRsSRecomMand")
{
getMainWin().location=T("$host$/cgi-bin/reader_detail?vs=1&feedid=$feedid$&itemid=$itemid$&t=compose&s=content&mailfmt=1&sid=$sid$&newwin=$isnewwin$&tmpltype=recommend&loc=reader_detail,rss_recommend,,2").replace({
host:(getTop().gsRssDomain||""),
feedid:eS.getAttribute("feedid"),
itemid:eS.getAttribute("itemid"),
sid:getSid(),
isnewwin:!!getTop().bnewwin
});
return false;
}

return true;
}





function goPrevOrNextMail(azh)
{
var dD,
cy=getMainWin();

if(!!(dD=S(["prevmail","nextmail"][azh?1:0],cy))
&&!dD.getAttribute("disabled"))
{

}
else if(!!(dD=S(["prevpage","nextpage","prevpage1","nextpage1"][azh?1:0],cy))
&&!dD.getAttribute("disabled"))
{
cy.location=dD.href;
}
}





function goBackHistory()
{
var Db=SN("readmailBack",getMainWin());
if(Db.length>0&&isShow(Db[0]))
{
fireMouseEvent(Db[0],"click");
return true;
}
return false;
}













function checkPerDelML(nc,aJt,dJ)
{
return delMailML(nc,aJt,"PerDel",dJ);
}









function delMailML(nc,aJt,aaD,dJ)
{
var az=dJ.nodeType==9?(dJ.defaultView||dJ.parentWindow):dJ,
aR=QMMailList.getCBInfo(az);
configPreRmMail(aR,'rmMail');
rmMail(aaD=="PerDel"?1:0,aR);
return;
}






function reportSpamML(bxl,dJ)
{

if(getTop().isSelectAllFld(getMainWin()))
{
return showError('\u4E0D\u80FD\u5BF9\u5168\u6587\u4EF6\u5939\u6267\u884C\u6B64\u64CD\u4F5C');
}

var az=dJ.nodeType==9?(dJ.defaultView||dJ.parentWindow):dJ,
aR=QMMailList.getCBInfo(az);


configPreRmMail(aR,'spammail');
(bxl?reportSpamJson:reportNoSpamJson)({bBlackList:true},aR);
return false;
}














function MLIUIEvent(AA,ao,eI)
{
var bk=AA.value,
bI=QMMailCache,
Cb=bI.isRefresh(ao),
wW=AA.parentNode;
while(wW.tagName.toUpperCase()!="TABLE")
{
wW=wW.parentNode;
}
var gc=GelTags("table",wW)[0],
zC=GelTags("td",GelTags("tr",gc)[0]),
cla=zC[1],
IZ=zC[zC.length-1];

AA.setAttribute('init','true');
QMReadedItem.addItem(AA);


if(IZ.className=="new_g")
{
IZ=zC[6];
}


var aoc=GelTags("div",gc),
TV;
for(var aK=aoc.length-1;aK>=0;aK--)
{
if(aoc[aK].className=="TagDiv")
{
TV=aoc[aK];
break;
}
}


if(bI.hasData(bk))
{
if(!Cb)
{
var aw=bI.getData(bk);
if(AA.getAttribute("unread")=="true")
{
bI.addVar("unread",-1);
}
aKm(AA,wW,false,aw.reply);
aKB(AA,wW);

if(aw.star!=null)
{
setClass(IZ,aw.star?"fg fs1":"fg");
bI.addVar("star",aw.star?1:-1);
}

if(aw.oTagIds)
{
var za=GelTags("table",gc),
ym=aw.oTagIds,
EQ,
aJE={};

if(TV)
{
for(var aK=za.length-1;aK>=0;aK--)
{
if(EQ=za[aK].getAttribute("tagid"))
{
aJE[EQ]=1;
}
}
for(var aaR in ym)
{
if(ym[aaR]===0)
{

QMTag.rmTagUI(TV,aaR);
}
else if(!aJE[aaR])
{

QMTag.addTagUI(TV,aaR,eI,bk,false);
}
}
}
}
}
else
{

bI.addData(bk,
{
bUnread:AA.getAttribute("unread")=="true",
oTagIds:{},
star:null,
reply:null
});
}
}

listMouseEvent(wW);

IZ.title=IZ.className=="fg"?"\u6807\u8BB0\u661F\u6807":"\u53D6\u6D88\u661F\u6807";
addEvent(IZ,'click',function(_aoEvent)
{
starMail(null,QMMailList.getCBInfo(ao,bk));
return stopPropagation(_aoEvent);
}
);

addEvent(wW,"click",GetListMouseClick(ao));
addEvent(wW,"selectstart",preventDefault);


var apy=gc.rows[0].cells[1];
if(apy.className.indexOf("fr")>-1)
{

loadJsFile("$js_path$qmtip0e556a.js",true);
addEvent(apy,"mouseover",MLI.aIc);
addEvent(apy,"mouseout",MLI.aIc);
}


addEvent(TV,'click',function(_aoEvent)
{
if(QMTag.readclose(_aoEvent,QMMailList.getCBInfo(ao,bk)))
{
return stopPropagation(_aoEvent);
}
}
);

dragML(wW,AA);

}






function MLI(daV,ao,eI,CX)
{














var aIm=SN("mailid",ao),
HA=aIm[aIm.length-1],
bk=HA.value,
_oItem=HA.parentNode,
bI=QMMailCache,
Cb=bI.isRefresh(ao);

while(_oItem.tagName.toUpperCase()!="TABLE")
{
_oItem=_oItem.parentNode;
}

MLIUIEvent(HA,ao,eI);


var bqf=HA.getAttribute("uw")=="1",
aKQ=bqf?ao.oPreUWMails:ao.oPreMails,
boa=aKQ.length,
bwS=Cb?2:1,

bqW=new Date()-new Date(parseInt(HA.getAttribute("totime")))<2592000000,

bnN=!/^(LP|ZP)/.test(bk)&&bqW&&HA.getAttribute("unread")=="true"&&boa<bwS&&!rdVer.log(bk);

if(bnN&&rdVer.isPre(eI))
{
var aT,
Cr=HA.getAttribute("gid");

aT=rdVer.url(bk,eI,CX,"",false,"",false,"",true);

if(aT)
{
aKQ.push(aT);
}
}

if(getTop().gsReadedMailId==bk)
{
QMReadedItem.disp(_oItem);
recordReadedMailId(null);
}

}









function MLJump(buQ,bqy,bj,ao)
{
var boF=SN("maillistjump",ao.document),
aHQ="_MlJuMp_",
US=parseInt(buQ)||0,
BQ=parseInt(bqy)||0;

function aGz(aI)
{
var kE=getTop().QMMenu(aI).S("txt"),
cI=parseInt(kE.value);

if(isNaN(cI))
{
kE.select();
return showError("\u8BF7\u8F93\u5165\u8DF3\u8F6C\u7684\u9875\u6570");
}

cI=Math.max(0,Math.min(cI-1,BQ));
if(US==cI)
{
kE.select();
return showError("\u4F60\u8F93\u5165\u4E86\u5F53\u524D\u9875\u6570");
}

getTop().QMMenu(aI).close();
goUrlMainFrm([bj,'&page=',cI,'&loc=mail_list,,jump,0',getTop().isSelectAllFld(getMainWin())?"&selectall=1":""].join(''));
}

E(boF,function(aad)
{
if(!aad.getAttribute(aHQ))
{
aad.setAttribute(aHQ,"1");
addEvents(aad,
{
click:function(_aoEvent)
{
var aU=unikey("mljump"),
_oPos=calcPos(aad),
cH=185,
da=40;


new(getTop().QMMenu)(
{
sId:aU,
oEmbedWin:ao,
nWidth:cH,
nX:_oPos[1]-cH,
nY:bodyScroll(ao,"scrollHeight")-_oPos[2]<da?(_oPos[0]-da-13):_oPos[2],
bAutoClose:false,
oItems:
[
{
nHeight:da,
sItemValue:MLJump.fA.replace({id:aU})
}
],
onshow:function()
{
this.S("txt").focus();
}
}
);

addEvent(getTop().QMMenu(aU).S("txt"),"keypress",function(_aoEvent)
{
var dQ=_aoEvent.keyCode||_aoEvent.which;
if(dQ===13)
{
aGz(aU);
}
else if((dQ<48||dQ>57)&&dQ!=8&&dQ!=9)
{
preventDefault(_aoEvent);
}
}
);

addEvent(getTop().QMMenu(aU).S("btn"),"click",function(_aoEvent)
{
aGz(aU);
}
);

preventDefault(_aoEvent);
}
}
);
}
}
);
}

MLJump.fA=T(
[
'<div style="position:absolute;width:160px;margin-left:-7px;">',
'<div class="addrtitle jumpmenusdjust" style="float:left;">\u8DF3\u8F6C\u5230\u7B2C <input id="txt" type="text" class="txt" style="width:30px;" /> \u9875</div>',
'<a id="btn" href="javascript:;" class="left button_gray_s" style="width:40px; margin:7px 0 0 5px; _display:inline;">&nbsp;\u786E\u5B9A&nbsp;</a>',
'</div>'
]
);







function initDropML()
{
function aaY(_aoDom)
{
var _oPos=calcPos(_aoDom),
hy=S('dragtitle'),
ty=hy.offsetLeft,
rY=hy.offsetTop;
return(_oPos[1]>ty&&_oPos[3]<ty&&_oPos[2]>rY&&_oPos[0]<rY)?_aoDom:null;
}

function Tg(_aoDom,aGx)
{
if(_aoDom&&_aoDom.id.indexOf('folder_')>=0)
{
var cP=_aoDom.className,
aKg=cP.indexOf('toolbg')>-1;
if(aGx&&aKg)
{
setClass(_aoDom,cP.replace(/\btoolbg\b/g,''));
}
else if(!aKg&&!aGx)
{
setClass(_aoDom,cP+' toolbg');
}
}
}

var hy=S('dragtitle'),
aHs=S('OutFolder'),
aJo='inidrop',
xQ=BaseMailOper.getInstance(getMainWin()),
aou=QMDragDrop,
aGC='mail_list';

if(aHs.getAttribute(aJo)=='true')
{

return false;
}
aHs.getAttribute(aJo,'true');
aou.delGroup(aGC);

var FM=null,

akY=false,
qc=null,
iq=null,
ki=null,



aJu=/^([489]|personal|pop|tag)$/,

akx=new aou.DropTarget(
S('OutFolder'),
{





ondragover:function(tE)
{
if(qc==iq)
{
return;
}
var bSb=qc&&qc.id||'',
II=iq&&iq.id||'',
anS=qc&&qc.getAttribute('dp'),
aoy=iq&&iq.getAttribute('dp'),
aHj=iq&&iq.getAttribute('dr');


if(aoy)
{
showFolders(aoy,true,getTop());
}
if(anS&&anS!=aoy)
{
showFolders(anS,false,getTop());
}

Tg(qc,1);
Tg(iq);


if(ki)
{
clearTimeout(ki);
}
akY=aHj&&!aJu.test(aHj);
ki=setTimeout(function(){
setClass(hy,akY?'drag_over':'drag_out');
ki=null;
},50);

qc=iq;
},





ondrop:function(tE)
{
if(!iq||!akY)
{
return;
}
var gx=xQ.getMailInfo().sFid,
aU=iq.getAttribute('dr')||'';
ossLog("delay","all","stat=drag&opr="+aU);


if(aU=='6')
{

Tg(qc,1);
qc=null;
xQ.apply('spammail');
dragML.aqj=true;
return;
}
else if(aJu.test(aU))
{
Tg(qc,1);
qc=null;
return;
}
else if(aU.indexOf('tag_')>=0)
{

aU=aU.replace('tag','tid');
}
else if(aU=='starred')
{
aU='star';
}
else if((gx==5||gx==6)&&aU==5)
{
aU='predelmail';
dragML.aqj=true;
}
else if(parseInt(aU))
{
aU={5:'delmail'}[aU]||'fid_'+aU;
}
else
{
return;
}
xQ.apply(aU);
hy.setAttribute('na','true');
var nx=new qmAnimation(
{
from:100,
to:1
}
);
nx.play(
{
speed:"slow",
onaction:function(ce,iz)
{
setOpacity(hy,ce/100.0);
},
oncomplete:function(ce,akA)
{
show(hy,0);
setClass(hy,'drag_out');
setOpacity(hy,100);
Tg(qc,1);
qc=null;
}
});
}
},
function(ty,rY,tE){






if(gbIsIE)
{
var aF=getEventTarget(tE.event),
bmd=/(folder_\w+_td|(personal|pop|tag)foldersDiv)/;
while(aF&&!bmd.test(aF.id))
{
aF=aF.parentNode;
}
iq=aF;
}
else if(iq=aaY(S('OutFolder')))
{


var gb=['personal','pop','tag'],
RV=null,
aHZ=null,
GP,
i;
for(i=gb.length-1;i>=0;i--)
{
if(RV=aaY(S(gb[i]+'foldersDiv')))
{
break;
}
}

if(RV=RV||aaY(S('SysFolderList')))
{

GP=GelTags('li',RV);
for(i=GP.length-1;i>=0;i--)
{
if(aHZ=aaY(GP[i]))
{
break;
}
}
}
iq=aHZ||RV;

}
return!!(qc||iq);
}
);
aou.addGroup(aGC,akx);
}

function dragML(_aoDom,ik)
{
if(!S('OutFolder')||!QMDragDrop)
{


return;
}
var ae=dragML,
aU='dragtitle',
hy=S(aU);
if(!hy)
{
insertHTML(getTop().document.body,'afterBegin','<div id="dragtitle" class="drag_out" style="display:none;"></div>');
hy=S(aU);
}
var FM,

Sw=new QMDragDrop.Draggable(
_aoDom,
{

threshold:5,
oTitle:hy
},
{
ondragstart:function(_aoEvent)
{
ae.aqj=ik.checked==true;
ik.checked=true;
var az=getMainWin(),
xQ=BaseMailOper.getInstance(az),
bR=QMMailList.getCBInfo(az);
QMMailList.selectedUI(bR);
xQ.setMailInfo(bR);
hy.innerHTML=['\u9009\u4E2D ',bR.oMail.length,' \u5C01\u90AE\u4EF6'].join('');

ossLog("delay","all","stat=drag&c="+bR.oMail.length);









FM=gbIsIE?[0,0,0,0]:calcPos(az.frameElement);
hy.style.left=FM[3]+_aoEvent.clientX+'px';
hy.style.top=FM[0]+_aoEvent.clientY+'px';
hy.setAttribute('na','');
show(hy,1);

initDropML();
},
ondrag:function(_aoEvent)
{
hy.style.left=FM[3]+_aoEvent.clientX+'px';
hy.style.top=FM[0]+_aoEvent.clientY+'px';
},
ondragend:function(_aoEvent)
{
if(!hy.getAttribute('na'))
{

show(hy,0);
setClass(hy,'drag_out');
}
if(!ae.aqj)
{
ik.checked=false;
var bhY=QMMailList.getCBInfo(getMainWin());
QMMailList.selectedUI(bhY);
}
}
}
);
QMDragDrop.addGroup('mail_list',Sw);


var aM=_aoDom.ownerDocument,
az=aM.parentWindow||aM.defaultView,
aav=dragML.aav=dragML.aav||unikey('drag');
if(!az[aav])
{
addEvent(az,'unload',function(){
if(hy.releaseCapture)
{
hy.releaseCapture();
}
show(hy,0);
});
az[aav]=1;
}
}




MLI.aIc=function(_aoEvent)
{
var _oTop=getTop(),
ae=arguments.callee,
DM=_aoEvent.clientX,
DP=_aoEvent.clientY,
bz=getEventTarget(_aoEvent);
while(bz&&bz.tagName.toUpperCase()!="TD")
{
bz=bz.parentNode;
}
if(ae.uS)
{
clearTimeout(ae.uS);
ae.uS=0;
}

if(_aoEvent.type=="mouseout")
{
_oTop.QMTip&&_oTop.QMTip.showMailList(0,bz.ownerDocument);
return;
}

ae.uS=setTimeout(function(){
var aJg=_oTop.GelTags("b",bz.parentNode.cells[2]),
aHA=aJg[aJg.length-1];

if(!_oTop.QMTip||!aHA||(ae.vN==DM&&ae.uD==DP))
{
return;
}

ae.vN=DM;
ae.uD=DP;

var Bc=aHA.innerHTML.replace(/^\&nbsp;-\&nbsp;/,"").replace(/\&nbsp;/gi,"&nbsp; ").replace(/&lt;br\/?&gt;/g,'<br/>');
_oTop.QMTip.showMailList(1,bz.ownerDocument,Bc,DM,DP);
},250);
};





function MLI_A(ez)
{
var Kl=GelTags("table",ez),
bxr=Kl.length,

_oItem=Kl[bxr-1],
bk=_oItem.getAttribute("mailid");

if(QMMailCache.hasData(bk))
{
if(!QMMailCache.isRefresh(window))
{
setClass(_oItem,"i M");
}
else
{
QMMailCache.delData(bk);
}
}

listMouseEvent(_oItem);

addEvent(_oItem,"selectstart",preventDefault);
}










function aHw(ik,Ae,sy,aaO)
{
if(!(ik&&ik.type=="checkbox"))
{
return false;
}

if(sy==null)
{
return ik.getAttribute("unread")=="true";
}

if(!Ae)
{
Ae=ik.parentNode.parentNode.parentNode.parentNode;
}

if((ik.getAttribute("unread")=="true")==!!sy
&&!aaO)
{
return sy;
}

var Cr=ik.getAttribute("gid");
if(Cr)
{
setGroupUnread(Cr,getGroupUnread(Cr)-1);
setGroupUnread("gall",getGroupUnread("gall")-1);
}

ik.setAttribute("unread",sy?"true":"false");

setClass(Ae,
[sy?"i F":"i M",ik.checked?" B":""].join(""));
setClass(GelTags("table",Ae)[0],sy?"i bold":"i");


var aIQ=GelTags("div",Ae)[1];
if(!/(s[016789]bg)|(Rw)/.test(aIQ.className))
{
var aji=aaO?"r":ik.getAttribute("rf"),
ajq=ik.getAttribute("isendtime"),
cP="Rr";

if(ajq)
{
cP=ajq=="0"?"Rc":"Ti";
}
else if(sy)
{
cP="Ru";
}
else if(aji)
{
cP=aji=="r"?"Rh":"Rz";
}

setClass(aIQ,"cir "+cP);
}

return sy;
}






function btw(ik)
{
return aHw(ik);
}









function aKm(ik,Ae,sy,aaO)
{
return aHw(ik,Ae,sy,aaO);
}








function aKB(ik,Ae)
{
if(!ik||!ik.getAttribute("gid"))
{
return false;
}

var aHn=GelTags("b",Ae)[0],
Ko=aHn&&aHn.parentNode;

if(Ko&&Ko.className=="new_g")
{
Ko.style.visibility="hidden";
return true;
}

return false;
}






function getMailListInfo()
{
var cy=getMainWin(),
aGN=S("_ut_c",cy),
aJH=S("_ur_c",cy),
aIF=S("_ui_c",cy);

return{
totle:(aGN&&parseInt(aGN.innerHTML))||0,
unread:(aJH&&parseInt(aJH.innerHTML))||0,
star:(aIF&&parseInt(aIF.innerHTML))||0
};
}






function bOo(dJ,aCh)
{
var GL=S("selectAll",dJ);

if(GL)
{
GL.setAttribute("totalcnt",aCh);
E(GelTags("div",GL),
function(bz,dk)
{
var abA=bz.getAttribute("un");
if(abA=="selected")
{
GelTags("span",bz)[0].setAttribute("end",aCh);
}
else if(abA=="unselect")
{
var bF=bz.innerHTML;
bz.innerHTML=bF.replace(/\u5168\u90E8.*\u5C01/gi,"\u5168\u90E8&nbsp;"+aCh+"&nbsp;\u5C01");
}
}
);
}
}








function setMailListInfo(CU,xo,aqD)
{
var cy=getMainWin(),
jb=true,
apr=S("_ur",cy),
bpi=S("_ui",cy),
brT=S("_ut",cy),
dD;

if(!isNaN(CU=parseInt(CU)))
{
if(!!(dD=S("_ur_c",cy)))
{
dD.innerHTML=Math.max(0,CU);
show(apr,CU>0);
}
else
{
jb=false;
}
var ZM=S("tip_unread",cy);
if(ZM)
{
ZM.innerHTML=CU<0?parseInt(ZM.innerHTML)+CU:CU;
show(ZM,CU);
}
}

if(!isNaN(xo=parseInt(xo)))
{
xo=Math.max(0,xo);
if(!!(dD=S("_ui_c",cy)))
{
dD.innerHTML=xo;
show(bpi,xo!=0);
}
else
{
jb=false;
}
}

if(!isNaN(aqD=parseInt(aqD)))
{
xo=Math.max(0,aqD);
if(!!(dD=S("_ut_c",cy)))
{
dD.innerHTML=xo;
show(brT,xo!=0);

getTop().bOo(cy,xo);
}
else
{
jb=false;
}
}

show(
S("_uc",cy),
isShow(apr)

);
show(
S("_ua",cy),
isShow(apr)

);

return jb;
}








function readMailFinish(aP,av,eI,btE)
{
var cy=getMainWin(),
apK=S("load_"+aP,cy),
_oItem,oN;

QMMailCache.addData(aP);

if(apK)
{
show(apK,false);

_oItem=apK.parentNode.previousSibling;
oN=GelTags("input",_oItem)[0];
}
else
{
var iY=GelTags("input",cy.document);
for(var i=0,_nLen=iY.length;i<_nLen;i++)
{
if(iY[i].type=="checkbox"
&&iY[i].value==aP)
{
oN=iY[i];
break;
}
}
_oItem=oN;
while(_oItem.tagName.toUpperCase()!="TABLE")
{
_oItem=_oItem.parentNode;
}
}


var za=GelTags("table",_oItem),
aKO=false;
for(var aK=za.length-1;aK>=0;aK--)
{
if(za[aK].getAttribute("tagid"))
{
aKO=true;
break;
}
}

aKB(oN,_oItem);

if(oN&&btw(oN))
{
aKm(oN,_oItem,false);
setMailListInfo(getMailListInfo().unread-1);


if(oN.getAttribute('star')=='1')
{
setFolderUnread('starred',getFolderUnread('starred')-1);
}

if(eI&&parseInt(eI)>0&&!aKO)
{
setFolderUnread(eI,btE
?getGroupUnread("gall")
:getMailListInfo().unread);
}
else
{
reloadLeftWin();
}
}
}








function checkMail(oG)
{
if(oG=="")
{
showError("\u6DFB\u52A0\u7684\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");
return false;
}

var bSW="([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)";
if(!new RegExp(bSW,"ig").test(oG))
{
showError("\u60A8\u8F93\u5165\u7684\u90AE\u7BB1\u5730\u5740\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165");
return false;
}

return true;
}








function checkAndSubmit(aI)
{
var bH=S(aI);

if(!checkMail(trim(bH.value)))
{
bH.focus();
return false;
}

submitToActionFrm(bH.form);
}






function pushToDialogList(aI)
{
var _oTop=getTop();

if(!_oTop.goDialogList)
{
_oTop.goDialogList=new _oTop.Object;
}

if(aI)
{
_oTop.goDialogList[aI]=true;
}
}





function showDialogNewReadMail(ceI,bRP,wb,aP)
{
new(getTop().QMDialog)({
sId:"addnewremind_qqmail",
sTitle:"\u65B0\u5EFA\u63D0\u9192",
sUrl:T("/cgi-bin/read_reminder?linkid=%linkid%&linktitle=%linktitle%&sid=%sid%&t=remind_edit&from=%from%","%").replace({
sid:getSid(),
linkid:ceI,
linktitle:bRP,
from:wb
}),
nWidth:450,
nHeight:360
})
aP&&rdVer(aP,1);
}

function setRemindSpan(aP,ao)
{


getTop().S('remind_edit_'+aP,ao).innerHTML=(getTop().reminddetail["mailid:"+aP]||"")
.replace(/linktitle=.*&sid=/g,function(bJ)
{
return bJ.replace(/\'/g,"&#039;");
}
);
}


function showSimpleRuleFilter(cQ)
{
if(!cQ)
{
showError("\u65E0\u6CD5\u83B7\u53D6\u53D1\u4EF6\u4EBA\u5730\u5740\uFF0C\u4E0D\u80FD\u521B\u5EFA\u89C4\u5219");
return;
}
var en=new(getTop().QMDialog)(
{
sId:"addnewfilter_qqmail",
sTitle:"\u5FEB\u6377\u521B\u5EFA\u6536\u4FE1\u89C4\u5219",
sUrl:T("/cgi-bin/setting2?sid=$sid$&Fun=GetFolderList&CurFilterID=0&t=readmail_filter&fromaddr=$fromaddr$").replace({
sid:getSid(),
fromaddr:cQ
}),
nWidth:410,
nHeight:240,
onshow:function()
{
var auM=this.getDialogWin();
waitFor(
function()
{
try
{
return S("jump",auM);
}
catch(e){}
},
function(aY)
{
if(aY)
{
function dkq(bpm)
{
if(bpm.length)
{
bpm.push({
bDisSelect:true,
nHeight:10,
sItemValue:'<hr/>'
});
}
bpm.push({
bDisSelect:false,
nHeight:22,
sId:"new",
sItemValue:'\u65B0\u5EFA\u6587\u4EF6\u5939...'
});

return bpm;
};
function cvr()
{
var LG=buq.get(2);

return LG=="new"?"-1":LG;
};
function cTI()
{
buq.set(aei[0].sId,2);
};
function dNN(aD,bJ)
{
var ctE={
bDisSelect:false,
nHeight:22,
sId:bJ,
sItemValue:aD
};

if(aei.length==1)
{
aei=bOu(aei,{
bDisSelect:true,
nHeight:10,
sItemValue:'<hr/>'
},0);
aei=bOu(aei,ctE,0);
}
else
{

aei=bOu(aei,ctE,aei.length-2)
}
buq.update({
oMenu:{
oItems:aei
}
});
buq.set(bJ,2);
};
function bOu(eW,bd,vL)
{
({}).toString.call([])!="[object Array]"&&(bd=[bd]);
return eW.slice(0,vL).concat(bd).concat(eW.slice(vL,eW.length));
};
function dQX()
{

promptFolder({
type:'folder',
bAlignCenter:true,
width:410,
height:237,
style:"createNewFolder",
onreturn:function(aD)
{
QMAjax.send(
"/cgi-bin/foldermgr",
{
method:"POST",
content:["sid=",getSid(),"&fun=new&from=simple&ef=js&resp_charset=UTF8&name=",aD].join(''),
onload:function(aY,vD)
{
try
{
if(aY)
{
var aw=eval("("+vD+")");
if(aw.errcode=="0")
{
dNN(aD,aw.folderid);
reloadLeftWin()
showInfo("\u5DF2\u6210\u529F\u65B0\u5EFA\u6587\u4EF6\u5939");
}
else
{
showError(aw.errmsg);
}
return;
}
}
catch(e)
{}
showError("\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002");
}
}
);
}
});
};

var aei=dkq(auM.oUserFolder)
buq=new QMSelect({
oContainer:S("selectfolder",auM),


oMenu:{
nWidth:"auto",
nMaxWidth:180,
nMaxItemView:4,
oItems:aei 
},
onselect:function(bd)
{
if(bd.sId=="new")
{
dQX();
return true;
}
}
});

addEvent(S("jump",auM),"click",function()
{
en.close();
var jY=cvr();
jY=="-1"&&(jY="");
getMainWin().location.replace(
auM.location.href
.replace("&Fun=GetFolderList","&Fun=Create")
.replace("&t=readmail_filter","&loc=filter,simple,0,0&folderid="+jY)
);
}
);
addEvent(S("confirm",auM),"click",function()
{
var jY=cvr(),
cLE=S("oldmail",auM).checked?1:0;

if(jY=="-1")
{
showError("\u60A8\u9700\u8981\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\u5939");
cTI();
}
else if(!jY)
{
showError("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");
cTI();
}
else
{
QMAjax.send(
"/cgi-bin/foldermgr",
{
method:"POST",
content:["sid=",getSid(),"&fun=addfilter&from=simple&ef=js&action=move&oldmail=",cLE,"&sender=",cQ,"&folderid=",jY].join(''),
onload:function(aY,vD)
{
try
{
if(aY)
{
var aw=eval("("+vD+")");
if(aw.errcode=="0")
{
if(cLE&&aw.affected>0)
{
showInfo(TE([
'\u64CD\u4F5C\u6210\u529F\uFF0C',
'$@$if($num$>0)$@$',
'\u79FB\u52A8\u4E86$num$\u5C01\u90AE\u4EF6\u3002',
'$@$else$@$',
'\uFF0C\u60A8\u6CA1\u6709\u9700\u8981\u79FB\u52A8\u6216\u6807\u8BB0\u7684\u90AE\u4EF6\u3002',
'$@$endif$@$',
'<a href="/cgi-bin/mail_list?sid=$sid$&folderid=$fid$&page=0"',
'style="color:white" onclick="getTop().hiddenMsg();" target="mainFrame">',
'[\u67E5\u770B]',
'</a>']).replace({
sid:getSid(),
fid:aw.folderid,
num:aw.affected
}),30000);
}
else
{
showInfo("\u5DF2\u6210\u529F\u65B0\u5EFA\u89C4\u5219");
}


ossLog("realtime","all","loc=filter,simple,0,1");
en.close();
}
else
{
showError(aw.errmsg);
}
return;
}
}
catch(e)
{}
showError("\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002");
}

}
);
}
}
);
addEvent(S("cancel",auM),"click",function()
{
en.close();
}
);
}
else
{
showError("\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u3002");
}
}
);
}
});

}
function closeSimpleRuleFilter(hj)
{
hj&&hj();
QMDialog("addnewfilter_qqmail").close();
}



function applyRules(cpi)
{
confirmBox({
title:"\u6536\u4FE1\u89C4\u5219",
msg:"\u60A8\u662F\u5426\u8981\u5BF9\u6536\u4EF6\u7BB1\u7684\u5DF2\u6709\u90AE\u4EF6\u6267\u884C\u6B64\u89C4\u5219?",
confirmBtnTxt:'\u662F',
cancelBtnTxt:'\u5426',
onreturn:function(aY)
{
if(aY)
{
QMAjax.send(T("/cgi-bin/exbook_mgr?sid=$sid$&fname=&optype=mailfilter").replace(
{
sid:getSid()
}),
{
method:"GET",
headers:{"If-Modified-Since":"0","Cache-Control":"no-cache, max-age=0"},
onload:function(aY,bN)
{
showInfo("\u6210\u529F\u5BF9\u6536\u4EF6\u7BB1\u5DF2\u6709\u90AE\u4EF6\u6267\u884C\u6B64\u89C4\u5219!");
callBack(cpi);
}
});
}
else
{
callBack(cpi);
}
}
});
}

function submitSwitchForm()
{
var eE=getTop().S("frmSwitch");
eE&&eE.submit();
}
















function getDomain(cdU)
{
return[["foxmail.com","qq.com","biz"],["Foxmail.com","QQ","\u817E\u8BAF"]][
cdU?1:0][/,7$/.test(getSid())?2:(location.href.indexOf("foxmail.com")>-1?0:1)];
}
var GetDomain=getDomain;





function getSid()
{
return getTop().g_sid
||(S("sid")?S("sid").value:location.getParams(getTop().location.href)["sid"]);
}
var GetSid=getSid;





function getUin()
{
return getTop().g_uin;
}





function getPaths()
{

var Vg=
{
images_path:"/zh_CN/htmledition/images/",
js_path:"/zh_CN/htmledition/js/",
css_path:"/zh_CN/htmledition/css/",
style_path:"/cgi-bin/getcss?sid="+getSid()+"ft=",
swf_path:"/zh_CN/htmledition/swf/",

stationery_path:"http://res.mail.qq.com/zh_CN/",
card_path:"http://res.mail.qq.com/zh_CN/",
mo_path:"http://res.mail.qq.com/zh_CN/",
base_path:"/",
skin_path:"0"
};
for(var k in Vg)
{
Vg[k]=trim(getTop()[k])||Vg[k];
}
return Vg;
}







function getPath(av,cdo)
{














av=="image"&&(av+="s");
var hX=getPaths()[av+"_path"]||"";
if(hX)
{
if(cdo&&av!="skin"&&hX.indexOf("http")!=0)
{
hX=[location.protocol,"//",location.host,hX].join("");
}
}
return hX;
}








function getRes(Yu)
{
return T(Yu).replace(getPaths());
}






function getFullResSuffix(gP)
{
if(!getTop().gLn)
{
return gP;
}
var _sFile,uv,aCY=".j"+"s";
if(gP.indexOf(aCY)>0)
{
_sFile=gP.substr(0,gP.indexOf(aCY));
uv=aCY;
}
else if(gP.indexOf(".css")>0)
{
_sFile=gP.substr(0,gP.indexOf(".css"));
uv=".css";
}
else if(gP.indexOf(".html")>0)
{
_sFile=gP.substr(0,gP.indexOf(".html"));
uv=".html";
}
if(_sFile.length>0&&getTop().gLn[_sFile])
{
return _sFile+getTop().gLn[_sFile]+uv;
}
else
{
return gP;
}
}












function outputJsReferece(eP,qI,ao)
{
var hX=eP||outputJsReferece.abl,
_oFileList=qI||outputJsReferece.oj,
az=ao||window,
bY=T(['<script language="JavaScript" src="$file$',(eP?'':'?r='+Math.random()),'"></','script>']),
vr=[];
outputJsReferece.abl=hX;
outputJsReferece.oj=_oFileList;

function bPs(jQ)
{
var _sFile=trim(jQ||""),
fF=/[0-9a-fA-F]{6}\.js$/.test(_sFile)?jQ.substr(0,jQ.length-9):jQ.split(".")[0];

if(fF&&(eP||!az[fF+"_js"]))
{
vr.push(bY.replace(
{
file:hX+jQ
}
));
}
}
E(_oFileList,bPs);
return vr.join("");
}





function runUrlWithSid(bj)
{
try
{

getTop().getHttpProcesser().src=T('$url$&sid=$sid$&r=$rand$').replace(
{
url:bj,
sid:getSid(),
rand:Math.random()
}
);
}
catch(bc)
{
}
}




























function createBlankIframe(ao,cd)
{
cacheByIframe(cd&&cd.defcss==false
?[]
:[["css","",getRes("$css_path$comm0f0f56.css")],["css",getPath("style"),"skin"]],
extend(
{
className:"menu_base_if",
transparent:false,
destroy:false
},
cd,
{
win:ao,
header:["<script>",getTop.toString().replace(/[\r\n]/g,""),"<\/script>",cd&&cd.header||""].join(""),
onload:function(ao)
{
if(this.getAttribute("cbi_inited")!="true")
{
cd&&cd.transparent&&
(this.contentWindow.document.body.style.background="transparent");
this.setAttribute("cbi_inited","true");
}
callBack.call(this,cd&&cd.onload,[ao]);
}
}
)
);
}






function createActionFrame(ao)
{
return createBlankIframe(ao,
{
id:"actionFrame",
defcss:false,
onload:actionFinishCheck
}
);
}
















function hideEditorMenu()
{
if(getTop().QMEditor)
{
getTop().QMEditor.hideEditorMenu();
}
}





function hideMenuEvent(_aoEvent)
{
var dR=getEventTarget(_aoEvent),
aba=getTop().QMMenu&&getTop().QMMenu();
for(var i in aba)
{
!aba[i].isContain(dR)&&aba[i].close();
}

try
{
getTop().QQPlusUI.hideMenuEvent(dR);
}
catch(Bq)
{
}
}






















function confirmBox(ay)
{

var	FL=2,
uI=ay.defaultChecked||false,
aDn=ay.confirmBtnTxt||"\u786E\u5B9A",
aGo=ay.cancelBtnTxt||"\u53D6\u6D88",
ail=ay.neverBtnTxt;



new(getTop().QMDialog)({
bAlignCenter:ay.bAlignCenter,
sId:ay.id||"QMconfirm",
sTitle:ay.title||"\u786E\u8BA4",
sBodyHtml:TE([
'<div class="$sStyle$">',
'$@$if($sType$=="custom")$@$',
'$msg$',
'$@$else$@$',
'<div class="cnfx_content">',
'<span class="dialog_icon icon_info_b"></span>',




'<div class="dialog_f_c">$msg$</div>',
'</div>',
'<div class="cnfx_status" style="display:$statusdisp$;">',
'<input id="recordstatus" class="cnfx_status_checkbox" type="checkbox" $checked$/><label for="recordstatus">$recordinfo$</label>',
'</div>',
'$@$endif$@$',
'</div>'
]).replace({
sStyle:ay.style||'',
sType:ay.sType||"",

msg:ay.msg,
caceldisp:ay.mode=="alert"?"none":"",
imgdisp:ay.mode=="prompt"?"none":"block",
recordinfo:ay.recordInfo,
statusdisp:ay.enableRecord?"":"none",
checked:ay.defaultChecked?"checked":"",


confrim:aDn,
confirmcss:getAsiiStrLen(aDn)>5?"":"wd2",
cancel:aGo,
cancelcss:getAsiiStrLen(aGo)>5?"":"wd2",
never:ail,
neverdisp:ail?'':'none',
nevercss:getAsiiStrLen(ail)>5?"":"wd2"
}),
sFootHtml:T([
'<div class=" txt_right cnfx_btn">',
'<input class="$confirmcss$ btn confirm" type="button" id="confirm" value="$confirm$">',
'<input class="$cancelcss$ btn cancel" type="button" id="cancel" style="display:$caceldisp$;" value="$cancel$">',
'<input class="$nevercss$ btn" type="button" id="never" style="display:$neverdisp$;" value="$never$">',
'</div>'
]).replace({
caceldisp:ay.mode=="alert"?"none":"",
confirm:aDn,
confirmcss:getAsiiStrLen(aDn)>5?"":"wd2",
cancel:aGo,
cancelcss:getAsiiStrLen(aGo)>5?"":"wd2",
never:ail,
neverdisp:ail?'':'none',
nevercss:getAsiiStrLen(ail)>5?"":"wd2"

}),


onload:function(){
var bM=this,
afI=bM.S("confirm"),
akf=bM.S("cancel"),
aiL=bM.S("never");








addEvents([afI,akf,aiL],
{
click:function(_aoEvent)
{
var _oDom=getEventTarget(_aoEvent);
if(_oDom==afI)
{
if(bM.S("recordstatus"))
{
uI=bM.S("recordstatus").checked;
}
FL=1;
}
else if(_oDom==aiL)
{
FL=3;
}
bM.close();
}
}
);
callBack.call(bM,ay.onload);
},
onshow:function(){

gbIsMac||this.S("confirm").focus();
callBack.call(this,ay.onshow);
},
onclose:function(){
callBack.call(this,ay.onclose)
},
onbeforeclose:function(){
try
{

callBack.call(this,ay.onreturn,[FL==1,uI,FL]);
}
catch(bc)
{
}
return true;
}
});
}










function alertBox(ay)
{
confirmBox(extend({mode:"alert"},ay))
}













function promptBox(ay)
{
var aiD=false,
bKc=ay.onreturn;
ay.onreturn=function(aY)
{
var ae=this;
callBack.call(ae,bKc,[aiD||aY,ae.S("txt").value]);
};
ay.msg=T(
[
'<div class="dialog_txt">',
'<div style="margin:0 10px 10px;" class="bold">$msg$</div>',
'<div style="margin:10px 10px 5px;"><input type="text" id="txt" style="width:352px;" class="txt" value="$defaultValue$"/></div>',
'<div style="margin:0 10px 10px;" class="f_size addrtitle">$description$</div>',
'</div>',
]
).replace(ay);
confirmBox(extend(
{
sType:"custom",
height:160,
onload:function()
{
var ae=this;
addEvent(ae.S("txt"),"keydown",function(_aoEvent)
{
if(_aoEvent.keyCode==13)
{
aiD=true;
ae.close();
}
}
);
},
onshow:function()
{
this.S('txt').select();
this.S("txt").focus();
}
},ay)
);
}











function loadingBox(ay)
{
if(!callBack(ay.oncheck))
{
var cC=new QMDialog(
{
sId:"LoAdINgBOx",
sTitle:ay.model+"\u6A21\u5757\u52A0\u8F7D\u4E2D...",
nWidth:400,
nHeight:200,
sBodyHtml:T(
[
'<div style="text-align:center;padding:58px;">',
'<img id="load" src="$images_path$ico_loading20aa5d9.gif">',
'<span id="err" style="display:none;">$model$\u6A21\u5757\u52A0\u8F7D\u5931\u8D25</span>',
'</div>'
]
).replace(extend(ay,{images_path:getPath("image")})),
onclose:function()
{
cC=null;
}
}
);
if(ay.js)
{
var _oFiles=[];
E(typeof ay.js=="string"?[ay.js]:ay.js,function(jQ)
{
_oFiles.push(jQ);
}
);
loadJsFileToTop(_oFiles);
}
waitFor(
function()
{
return callBack(ay.oncheck);
},
function(aY)
{

if(!cC)
{
return;
}
if(!aY)
{
show(cC.S("load"),false);
show(cC.S("err"),true);
}
else
{
cC.close(true);
callBack(ay.onload);
}
}
)
}
else
{
callBack(ay.onload);
}
}





















(function()
{
var _oTop=getTop();

function bJd(aAm,apl)
{
var aAm="weixinCss";

if(!_oTop.S(aAm))
{
var Uz=_oTop.document.createElement("style");
Uz.type="text/css";
Uz.id=aAm;
if(_oTop.gbIsIE)
{
Uz.styleSheet.cssText=apl;
}
else
{
Uz.innerHTML=apl;
}
_oTop.document.getElementsByTagName("head")[0].appendChild(Uz);
}
}

var bIT=TE([
'<div id="mask" class="editor_mask opa50Mask editor_maskAtt" ></div>',
'<div id="out" style="z-index:1000;position: absolute;width:$width$%;height:$height$%;margin-top:$offsetTop$%;margin-left:$offsetLeft$%;outline:0;" tabindex="-1" hidefocus="hidefocus">',
'<a id="close" href="javascript:;" title="\u5173\u95ED" style="$@$if($noclose$)$@$display:none$@$endif$@$;position:absolute;right:0;top:16px;width:23px;height:23px;margin:-24px -9px 0 0;background:url($images_path$newicon/login087169.png) no-repeat 0 0;"></a>',
'<div id="body" style="width:100%;height:100%">$html$</div>',
'</div>'
]);


function maskPanel(ap)
{
bJd(ap.sId,ap.sCssRule);

new QMPanel(
{
oEmbedWin:_oTop,
sStyle:"position:absolute;width:100%; height:100%; left:0; top:0; margin-top:-2px",
nWidth:"auto",
nHeight:"auto",
sId:"weixinnote",
sBodyHtml:bIT.replace(
{
noclose:ap.bNoCloseBtn,
html:ap.sBodyHtml,
images_path:getPath("image"),
offsetTop:(100-ap.nHeightPercent)/2,
offsetLeft:(100-ap.nWidthPercent)/2,
width:ap.nWidthPercent,
height:ap.nHeightPercent
}),
onclose:ap.onclose,
onload:function()
{
var aeh=this;
aeh.S("mask").onclick=aeh.S("close").onclick=function()
{
aeh.close();
}
ap.onload&&callBack.call(aeh,ap.onload,[aeh]);
}
}
);
}
window.maskPanel=maskPanel;
})();




function getQMPluginInfo(bKw)
{
var b=
(gbIsWin&&
(


(gbIsFF&&gsFFVer.split(".")[0]>=3&&(gsFFVer.split(".")[1]>0||gsFFVer.split(".")[2]>=8||parseInt(navigator.buildID.substr(0,8))>=20090701))
||(gbIsChrome&&(""+gsChromeVer).split('.')[0]>=6)
||(gbIsSafari&&gsAgent.indexOf("se 2.x metasr 1.0")<0)
||(gbIsOpera)
||(gbIsQPlus)
||(gbIsQBWebKit&&getQMPluginInfo.aQP(gsQBVer,"6.5")>0)
)
)
||(gbIsMac&&gsMacVer>=bKw&&
(
gbIsFF&&parseFloat(gsFFVer)>=3.6
||gbIsChrome&&parseFloat(gsChromeVer)>=8
||gbIsSafari&&parseFloat(gsSafariVer)>=5
||gbIsQBWebKit
)
);
return b;
}







getQMPluginInfo.aQP=function(cUp,cUd)
{
var bxU=cUp.split("."),
bCn=bxU.length,
bxQ=cUd.split("."),
bBY=bxQ.length;
for(var i=0;i<bCn&&i<bBY;i++)
{
var bFF=parseInt(bxU[i]),
bFz=parseInt(bxQ[i]);
if(bFF==bFz)
{
continue;
}
return bFF>bFz?1:-1;
}
if(i<bCn)
{
return 1;
}
if(i<bBY)
{
return-1
}
return 0;
};




var QMAXInfo=
{
aWv:
{
path:"/activex/",
cab:["TencentMailActiveX.cab","TencentMailActiveX_2.cab"],
exe:"TencentMailActiveXInstall.exe",

obj:[
["TXGYMailActiveX.ScreenCapture","TXGYMailActiveX.UploadFilePartition",
"TXGYMailActiveX.Uploader","TXFTNActiveX.FTNUpload","TXGYMailActiveX.DropFile"]],
available:["ScreenCapture","Uploader","FTNUpload","DropFile","UploadFilePartition"],
lastVer:["1.0.1.35","1.0.1.29","1.0.1.35","1.0.0.18","1.0.0.8"],
miniVer:[(getDomain()=="foxmail.com")?"1.0.0.5":"1.0.1.28",
"1.0.1.28","1.0.1.28","1.0.0.11","1.0.0.7"]
},

aQL:
{
path:"/xpi/",
xpi:"TencentMailPlugin.xpi",

obj:["ScreenCapture","","Uploader","FTNUpload",""],
available:["ScreenCapture","Uploader","FTNUpload"],
name:["QQMail Plugin","","QQMail Plugin","Tencent FTN plug-in","QQMail Plugin"],




type:(function()
{
var AR="application/txftn",
aZi="application/txftn-webkit";
return["application/x-tencent-qmail","","application/x-tencent-qmail",
(typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes[aZi]?aZi:AR,
"application/x-tencent-qmail"];
})(),
lastVer:["1.0.1.35","","1.0.1.35","1.0.0.3","1.0.0.0"],
miniVer:["1.0.1.28","","1.0.1.28","1.0.0.1","1.0.0.0"]
},

aGu:
{
path:"/crx/",
crx:"TencentMailPlugin.crx",
exe:"QQMailWebKitPlugin.exe",
obj:["ScreenCapture","","Uploader","FTNUpload",""],
available:["ScreenCapture","FTNUpload"],
name:["QQMail Plugin","","QQMail Plugin","Tencent FTN plug-in",""],
type:["application/x-tencent-qmail-webkit","","application/x-tencent-qmail-webkit","application/txftn-webkit",""],
lastVer:["1.0.1.35","","1.0.1.35","1.0.0.3",""],
miniVer:["1.0.1.28","","1.0.1.28","1.0.0.1",""]
},

aOg:
{
path:"/crx/",
pkg:"TencentMailPluginForMac.pkg",
obj:["ScreenCapture","","Uploader","FTNUpload",""],
available:["ScreenCapture","Uploader"],
name:["QQMailPlugin","","QQMailPlugin","Tencent FTN Plug-in",""],
type:["application/x-tencent-qmail-webkit","","application/x-tencent-qmail-webkit","application/txftn",""],
lastVer:["1.0.1.34","","1.0.1.34","1.0.0.3",""],
miniVer:["1.0.1.34","","1.0.1.34","1.0.0.3",""]
},







mbAblePlugin:getQMPluginInfo(10.6),



mbAbleUsePlugin:getQMPluginInfo(10.6),




bYE:true,

getTitle:function()
{
return gbIsIE?"\u63A7\u4EF6":"\u63D2\u4EF6";
},




getinfo:function()
{
if(QMAXInfo.mbAblePlugin)
{
if(gbIsWin)
{
if(gbIsIE)
{
return QMAXInfo.aWv.available;
}
if(gbIsFF)
{
return QMAXInfo.aQL.available;
}
if(gbIsChrome||gbIsSafari||gbIsOpera||gbIsQBWebKit)
{
return QMAXInfo.aGu.available;
}
}
if(gbIsMac)
{
return QMAXInfo.aOg.available;
}
}

return[];
},




bXP:function()
{








},











installer:function(av,oE)
{
var _oInfo=this.get("whole"),
fF="";
if(/^online/.test(av))
{
fF=_oInfo.cab||_oInfo.xpi||(gbIsChrome&&_oInfo.crx);
}
else if(/^download/.test(av))
{
if(oE)
{
if(oE=='chrome')
{
_oInfo=this.get("whole",'WebKit');
}
else
{
_oInfo=this.get("whole",oE);
}
}
if(oE)
{
fF=_oInfo.exe||_oInfo.pkg;
}
else
{
fF=(!gbIsChrome&&_oInfo.exe)||_oInfo.pkg;
}

if(oE=='chrome')
{
fF=_oInfo.crx;
}
}
if(fF&&/Abs$/.test(av))
{
fF=_oInfo.path+fF;
}
return fF;
},







get:function(aiI,Uh)
{
if(!Uh)
{
gbIsIE&&(Uh="IE");
gbIsFF&&(Uh='FF');
(gbIsChrome||gbIsSafari||gbIsOpera||gbIsQBWebKit)&&(Uh="WebKit");
!gbIsIE&&gbIsMac&&(Uh="mac");
}

var jC={
IE:this.aWv,
FF:this.aQL,
WebKit:this.aGu,
mac:this.aOg
}[Uh];

if(!this.bYE)
{
this.bXP();
}

if(aiI=="whole")
{
return jC;
}
else if(aiI=="cab")
{
var kS=createActiveX(0),
fF=kS?"":"_2.dll";
try{fF=kS.GetDLLFileName();}catch(e){}
return jC["cab"][fF&&fF.indexOf("_2.dll")!=-1?0:1];
}

return jC[aiI];
}
};






function createActiveX(zc,ao)
{
if(!gbIsIE)
{
return createPlugin(zc,false,ao);
}

if(zc>=0&&zc<=4)
{
var qj=QMAXInfo.get("obj");
for(var i=0,len=qj.length;i<len;i++)
{


















try
{
return new ActiveXObject(qj[i][zc]);
}
catch(bc)
{
}
}
}
return null;
}








function detectActiveX(zc,Kj,aDv,dQS)
{
if(!gbIsIE)
{
return detectPlugin(zc,Kj,aDv,dQS);
}

var Pv=typeof(aDv)=="undefined",
BU=false,
vK=Pv?createActiveX(zc)
:aDv,
hx=getActiveXVer(vK);




if(vK&&hx)
{

if(Kj!=1&&Kj!=2)
{
BU=true;
}
else if(parseInt(hx.split(".").join(""))
>=parseInt(QMAXInfo.get(Kj==1
?"miniVer"
:"lastVer")[zc].split(".").join("")))
{
BU=true;
}

if(Pv)
{
delete vK;
vK=null;
}
}
return BU;
}






function getActiveXVer(bu)
{
if(!gbIsIE)
{
return getPluginVer(bu);
}

var hx="",
vK;
try
{
vK=typeof(bu)=="number"?createActiveX(bu):bu;
hx=vK&&(vK.version
?vK.version
:"1.0.0.8")||"";
}
catch(bc)
{
}

return hx;
}






function checkInstallPlugin(nH)
{

if(!QMAXInfo.mbAbleUsePlugin)
{
return false;
}

try
{

navigator.plugins.refresh(false);
}
catch(e)
{
}

var aQ=QMAXInfo.get("name")[nH],
aW=QMAXInfo.get("type")[nH],
xV=navigator.plugins;
if(xV&&aQ)
{
for(var i=xV.length-1;i>=0;i--)
{
for(var j=xV[i].length-1;j>=0;j--)
{
if(xV[i].name.indexOf(aQ)!=-1&&xV[i][j].type==aW)
{

if(nH!=3&&(gsAgent.indexOf("vista")>-1||/nt 6/gi.test(gsAgent))&&aW=="application/x-tencent-qmail")
{
var bbY=xV[i].description.split('#')[1];
if(!bbY)
{

continue;
}
}

var bbY=/(\d+(?:\.\d+)+)/.test(xV[i].description||"")?RegExp.$1:"1.0.0.0";
if(gbIsMac&&nH!=3&&bbY=="1.0.0.0")
{
continue;
}

return true;
}
}


}
}
return false;
}









function createPlugin(nH,bHY,ao,yY)
{
var hP=null;
ao=ao||getMainWin();
switch(nH)
{
case 0:
case 2:
case 4:
if(gbIsSafari)
{
createPlugin.aWO(nH,ao,yY);
}
hP=createPlugin.aWO(nH,getTop(),yY);
break;
case 3:
hP=createFTNPlugin(ao,yY);
break;
}


if(!bHY&&checkInstallPlugin(nH))
{

getTop().ossLog("delay","all",
T([
'stat=ff_addon',
'&type=%type%&info=%info%'
],'%').replace({
type:!hP?"failcreatePlugin":"successcreatePlugin",
info:["ver:",gsFFVer,",pluginId:",nH,",brtpe:",(gbIsFF?1:(gbIsChrome?2:(gbIsSafari?3:(gbIsOpera?4:5))))].join("")
})
);
}
return hP;
}

createPlugin.aWO=function(nH,ao,yY)
{
var ng,
hP=null,
asj=gbIsFF?"application/x-tencent-qmail":"application/x-tencent-qmail-webkit";
ao=ao||getTop();
if(checkInstallPlugin(nH))
{
var Zo=yY||"QQMailFFPluginIns";
if(!(ng=S(Zo,ao)))
{
insertHTML(

ao.document.body,
"beforeEnd",
T('<embed id="$id$" type="$type$" hidden="true"></embed>').replace({

type:asj,
id:Zo
})
);
ng=S(Zo,ao);
}

var ajD={0:"CreateScreenCapture",
2:"CreateUploader",
4:"CreateDragDropManager"
}[nH];
if(typeof ng[ajD]!="undefined")
{
hP=ng[ajD]();



if(nH==0)
{
hP.OnCaptureFinished=function(){};
}
else if(nH==2)
{
hP.OnEvent=function(){};
}
}
}
return hP;
};

createPlugin.aUs=function(ao,yY)
{
var ng=null,


asj=QMAXInfo.get("whole")["type"][3],
aFL=yY||"npftnPlugin";
ao=ao||getTop();
if(!(ng=S(aFL,ao)))
{
insertHTML(
ao.document.body,
"beforeEnd",
T('<embed id="$id$" type="$type$" style="z-index:99999;position:absolute;top:0;left:0;width:1px;height:1px;"></embed>').replace({

type:asj,
id:aFL
})
);
ng=S(aFL,ao);
if(ng)
{
ng.onEvent=function(){};
}
}
return ng;
};







function createFTNPlugin(ao,yY)
{
if(!checkInstallPlugin(3))
{
return null;
}
createPlugin.aUs(ao,yY);
var ng=createPlugin.aUs(getTop(),yY);
















if(yY)
{

getTop().ossLog("delay","all",T([
'stat=ff_addon',
'&type=%type%&info=%info%'
],'%').replace({
type:ng&&ng.Version?"successcreatePlugin":"failcreatePlugin",
info:["ver:",gsFFVer,",pluginId:3,insId:",yY].join("")
}));
}

return ng.Version?ng:null;
}






function detectPlugin(nH,Kj,bNr,yY)
{

var BU=false;
var aGd=bNr||createPlugin(nH,true,null,yY),
hx=getPluginVer(aGd);

if(aGd&&hx)
{
if(Kj!=1&&Kj!=2)
{
BU=true;
}
else if(parseInt(getPluginVer(aGd).split(".").join(""))
>=parseInt(QMAXInfo.get(Kj==1?"miniVer":"lastVer")[nH].split(".").join("")))
{
BU=true;
}
}
return BU;
}



function getPluginVer(bu)
{
var vK,hx="";
try
{
vK=typeof(bu)=="number"?createPlugin(bu,true):bu;
hx=(vK&&vK.Version)||"";
}
catch(bc)
{
}

return hx;
}








































function initDialog(aI,Aw,bj,qL,mB)
{
new(getTop().QMDialog)({
sid:aI,
sTitle:Aw,
sUrl:bj,
nWidth:qL,
nHeight:mB
});
}








function requestShowTip(Lc,bKS,ao,bL)
{
var aT=T('/cgi-bin/tip?sid=$sid$&args=$dom$,$tip$&r=$r$').replace({
sid:getSid(),
dom:Lc,
tip:bKS,
r:Math.random()
});


QMAjax.send(aT,{
method:'GET',
onload:function(aY,bN,fP)
{
if(aY&&bN.indexOf('oTop.QMTip')>0)
{
if(!bL||bL(bN,fP))
{
globalEval(bN,ao);
}
}
}
});
}

function detectCapsLock(xK,bxt,ez)
{
if(!xK)
{
return;
}
function showTips(_aoEvent)
{
var aF=_aoEvent.target||_aoEvent.srcElement,
_oPos=calcPos(aF),
cY=bxt||S("capTip");

function getStyle()
{
return["z-index:20;position:absolute;background:#fdf6aa;padding:1px;",
"border:1px solid #dbc492;border-right:1px solid #b49366;border-bottom:1px solid #b49366;",
"left:",_oPos[3],"px;","top:",(_oPos[2]+1),"px;"].join("");
}
if(!cY)
{
insertHTML((ez||document).body,"afterBegin",
'<div id="capTip" style="'+getStyle()+'">\u5927\u5199\u9501\u5B9A\u5DF2\u6253\u5F00</div>');
}
else
{
cY.style.cssText=getStyle();
}
}
function hideTips()
{
show(S("capTip",(ez||document)),false);
}
var Fp=-1;
addEvents(xK,{
keydown:function(_aoEvent)
{
var iy=_aoEvent.keyCode||_aoEvent.charCode

if(iy==20)
{
if(Fp==0)
{
showTips(_aoEvent);
Fp=1;
}
else if(Fp==1)
{
hideTips();
Fp=0;
}

}
},
keypress:function(_aoEvent)
{
var iy=_aoEvent.keyCode||_aoEvent.charCode,
xP=_aoEvent.shiftKey;

if((iy>=65&&iy<=90&&!xP)
||(iy>=97&&iy<=122&&xP))
{
Fp=1
showTips(_aoEvent);
}
else if((iy>=97&&iy<=122&&!xP)||(iy>=65&&iy<=90&&xP))
{
Fp=0;
hideTips();
}
else
{
hideTips();
}
},
blur:function()
{
hideTips();
}
});
}








function calcMainFrameDomInGlobalPos(cdS,awb)
{
var _oPos=calcPos(cdS),
aXy=calcPos(S("mainFrame",getTop())),
bbh=getMainWin().document,
aUn=bbh.documentElement,
aUR=bbh.body,
dN=_oPos[3]+aXy[3]
-(aUn.scrollLeft||aUR.scrollLeft||0),
bU=_oPos[0]+aXy[0]
-(aUn.scrollTop||aUR.scrollTop||0),
cH=_oPos[4],
da=_oPos[5];

return awb=="json"
?{top:bU,bottom:bU+da,left:dN,
right:dN+cH,width:cH,height:da}
:[bU,dN+cH,bU+da,dN,cH,da];
}

function allDeferOK()
{
return typeof all_defer_js=="function"
}






















function attachSetFlag(bu,aiN,bL)
{
bu="&mailattach="+(typeof bu=="string"?bu.split(","):bu).join("&mailattach=");

var _oTop=getTop(),
aT=[bu,"&action=",aiN?"setflag":"cancelflag"].join(""),
aXQ=aiN?"\u6536\u85CF":"\u53D6\u6D88\u6536\u85CF";


QMAjax.send(
"/cgi-bin/attachfolder?t=attachfolder.json",
{
method:"POST",
content:["r=",Math.random(),aT].join(""),
onload:function(aY,bu)
{
if(aY)
{
try
{
var aw=eval(bu);
_oTop.showInfo("\u9644\u4EF6\u5DF2"+aXQ);
bL&&bL.call(null,aw);
}
catch(e)
{
_oTop.showError(aXQ+"\u5931\u8D25");
}
}
else
{
_oTop.showError("\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");
}
}
}
);
};




















function getAttachList(bu,bL,cd)
{
cd=cd||{};
var tS=arguments.callee,
aZ=arguments,
_oList=(typeof bu=="object"&&bu.length)?bu:[],
bpw=T("/cgi-bin/readmail?sid=$sid$&t=$t$&s=forward&from=attachfolder&disptype=html&ef=js$param$"),
rD=TE([
'$@$for($oAttach$)$@$',
'&mailattach=$mailid$|$attachid$|$attachname$|$fileextenal$|$filebyte$',
'$@$if($editname$)$@$',
'|$editname$',
'$@$endif$@$',
'$@$endfor$@$'
]).replace({
oAttach:_oList
});

QMAjax.send(bpw.replace({
sid:getSid(),
t:"compose.json",
param:rD
}),
{
method:"GET",
onload:function(aY,cr)
{
var ee=true;
if(aY)
{
try
{
var aw=eval(cr),
rQ=aw.attach;
if(rQ&&rQ.length)
{
for(var i=0;i<rQ.length;i++)
{
if(+rQ[i]["byte"]==0)
{
ee=false;
break;
}
}
}
else
{
ee=false;
}
}
catch(e)
{
ee=false;
}
}

if(ee&&aY)
{
bL(true,aw);
}
else
{
bL(false,aw);
}
}
},
cd.ajax
);




























};






function mailRecall(ek,ay,kd)
{
var eg=kd||{},
Jt=extend(
{
r:Math.random(),
sid:getSid()
},
ay
);

if(eg.onbeforesend&&eg.onbeforesend()===false)
{
return;
}
QMAjax.send(
"/cgi-bin/send_status",
{
method:"POST",
content:!ek?
T('t=send_status.json&s=mailrecallv2&messageid=$msgid$&time=$time$&sid=$sid$&r=$r$&ef=js').replace(Jt):
T('t=send_status.json&s=mailrecall_queryv2&taskid=$taskid$&sid=$sid$&r=$r$&ef=js').replace(Jt),
onload:function(aY,bu)
{
if(aY)
{
try
{
var aw=eval(["(",bu,")"].join(""));
if(+aw.errcode>-1)
{
eg.onsuccess&&eg.onsuccess(aw);
return;
}
else
{
showError(aw.errmsg||(ek==1?"\u67E5\u8BE2\u90AE\u4EF6\u64A4\u56DE\u72B6\u6001\u5931\u8D25\uFF0C\u64A4\u56DE\u7ED3\u679C\u5C06\u7A0D\u540E\u901A\u77E5\u4F60":"\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"));
}
}
catch(e)
{
showError(aw.errmsg||(ek==1?"\u67E5\u8BE2\u90AE\u4EF6\u64A4\u56DE\u72B6\u6001\u5931\u8D25\uFF0C\u64A4\u56DE\u7ED3\u679C\u5C06\u7A0D\u540E\u901A\u77E5\u4F60":"\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"));
}
eg.onerror&&eg.onerror(bu);
}
else
{
bu!="abort"
&&showError(aw.errmsg||(ek==1?"\u67E5\u8BE2\u90AE\u4EF6\u64A4\u56DE\u72B6\u6001\u5931\u8D25\uFF0C\u64A4\u56DE\u7ED3\u679C\u5C06\u7A0D\u540E\u901A\u77E5\u4F60":"\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"));
eg.onerror&&eg.onerror(bu);
}
eg.oncomplete&&eg.oncomplete(aY,bu);
}
}
);
};





function backHome(bWj)
{
getMainWin().location.href=T('/cgi-bin/today?sid=$sid$&loc=backhome,,,$locid$')
.replace(
{
sid:getSid(),
locid:bWj||140
}
);
}






function resizeFolderList()
{
var aCZ=S("SysFolderList"),
azO=S("ScrollFolder"),
jp=S("folder");

if(aCZ&&azO&&jp)
{
var aFy=["auto","hidden"],
bck=jp.clientHeight,
aZK=aCZ.offsetHeight,
Pf=bck-aZK,
aCI=Pf<50?0:1;
jp.style.overflow=aFy[aCI];
jp.style.overflowX=aFy[1];
azO.style.overflow=aFy[1-aCI];
azO.style.height=aCI
?(bck-aZK)+"px":"auto";
}

AD.setAdFlag();
AD.adjustADDisp();
}






function setTopSender(cd)
{
var NK=getTop().goUserInfo.get("DEF_MAIL_FROM")||'';
switch(cd&&cd.action)
{
case"setting4":
if(NK!=cd.email)
{
setUserInfo("addr",cd.email);
setDefaultSender(cd.email);
changeStyle(cd.skin,cd.logo);
getTop().skin_path=cd.skin;
clearCache(["css",getPath("style"),"skin"]);
}


getTop().goUserInfo.reset();
break;
}
}




function bindAccount()
{
var amo=S("useraddr"),
aGr=S("useraddrArrow"),
Du=getTop().goUserInfo.get('RealBindAccount'),
MP={nHeight:10,sItemValue:'<div style="background:#CCC; height:1px; margin-top:5px; overflow:hidden;"></div>'},
bv=[],
aZR=amo&&subAsiiStr(amo.innerHTML,20,"...");

if(!amo||!Du)
{
return;
}

if(Du.qq.length+Du.biz.length)
{
bv.push(
{
sItemValue:'<a id="manage" href="javascript:;" style="float: right;">\u7BA1\u7406</a><span class="ml">\u5173\u8054\u5E10\u53F7\uFF1A</span>'
},
{
sId:'self',
bDisSelect:true,
sItemValue:T('<div class="unread_num"><span class="ico_unreadnum"></span>$unread$</div><input type="button" class="ft_upload_success" id="self"/><span style="overflow:hidden;margin-left:0" >$myemail$</span>').replace(extend({myemail:subAsiiStr(aZR,19,"...")},Du.self))
}
);
E(['qq','biz'],function(bJ,dk)
{
var cj=Du[bJ].length;
if(cj&&dk)
{
bv.push(MP);
}
for(var cj=Du[bJ].length,i=0;i<cj;i++)
{
var aw=Du[bJ][i],

fD=subAsiiStr(aw['email'],19,"...");














bv.push(
{
aW:bJ,
sId:aw.uin,
sItemValue:['<div class="unread_num"><span class="ico_unreadnum"></span>',aw.unread,'</div>','<span style="overflow:hidden;">',fD,'</span>'].join('')
}
);
}
}
);
}
else
{

bv.push(
{
sItemValue:'<span>\u60A8\u7684\u5F53\u524D\u90AE\u7BB1\u5E10\u53F7\uFF1A</span>'
},
{
sItemValue:T('<strong class="ml black">$myemail$</strong>').replace({myemail:aZR})
},
MP,
{
sItemValue:'<span>\u62E5\u6709\u5907\u7528\u90AE\u7BB1\uFF0C\u6765\u9002\u7528\u4E8E\u4E0D\u540C\u7528\u9014\u3002</span>'
},
{
sItemValue:'<span>\u5B83\u4EEC\u53EF\u4EE5\u5173\u8054\u5728\u4E00\u8D77\uFF0C</span>'
},
{
sItemValue:'<span>\u65B9\u4FBF\u968F\u610F\u5207\u6362\u4E0D\u540C\u7684\u90AE\u7BB1\u3002</span>'
},
{
nHeight:35,
sItemValue:'<input id="bind" type="button" class="btn ml"value="\u7533\u8BF7\u5907\u7528\u90AE\u7BB1" style="margin-top:5px;padding:0 10px;overflow:visible;"/>&nbsp; <a href="/cgi-bin/readtemplate?sid=$sid$&t=attrpwd_sec" target="mainFrame" id="bind_a">\u5173\u8054\u5DF2\u6709\u90AE\u7BB1</a>'
}
);
}
if(aGr)
{
aGr.style.visibility="visible";
aGr.parentNode.onclick=function()
{
var rO=calcPos(amo.parentNode);
new QMMenu(
{
sId:"bindaccount",
sClassName:"bindacc qmpanel_shadow",

nX:rO[3],
nY:rO[2],
nWidth:235,
nMinWidth:160,
nItemHeight:25,
oItems:bv,
onitemclick:function(aI,bd)
{
if(bd.aW=='biz')
{
submitSwitchForm();
}
else
{
goUrlTopWin(T('/cgi-bin/login?vt=relate&uin=$uin$&old_sid=$sid$').replace({
uin:aI,
sid:getSid()
})
);
}
},
onload:function()
{
var ae=this,
aWi=ae.S("self"),
cD;
if(aWi)
{
cD=aWi.parentNode;
setClass(cD,cD.className+' settingtable');
}

addEvent(ae.S("manage"),'click',function(_aoEvent)
{

goUrlMainFrm(
T("/cgi-bin/setting4?fun=list&acc=1&sid=$sid$&go=bind").replace({sid:getSid()})
);
ae.close();
preventDefault(_aoEvent);
}
);

addEvent(ae.S("bind"),'click',function(_aoEvent)
{

goUrlMainFrm(
T("/cgi-bin/readtemplate?sid=$sid$&t=attrpwd_sec_alone&s=regemail&by=beiyong").replace({sid:getSid()})
);
ae.close();
preventDefault(_aoEvent);
}
);

addEvent(ae.S("bind_a"),'click',function(_aoEvent)
{

goUrlMainFrm(
T("/cgi-bin/readtemplate?sid=$sid$&t=attrpwd_sec").replace({sid:getSid()})
);
ae.close();
preventDefault(_aoEvent);
}
);

}
}
);
};
}
}

bindAccount.dPN=function()
{
var ae=arguments.callee;
if(ae.uS)
{
}

};




function initAddress(bL)
{
callBack.call(window,bL,[{sType:"loading",sMsg:""}]);

var _oTop=getTop(),
PW=_oTop.document,
cdu=getPath("js"),
ff=0,
vX=function()
{
if(++ff>=2)
{
_oTop.QMAddress.initAddress(bL);
}
};

loadJsFile("$js_path$qmlinkman0de70b.js",true,PW,vX);
loadJsFile("$js_path$qmaddress0de70b.js",true,PW,vX);






























}




function getPhotoCGI()
{
return[location.protocol,"//",location.host,"/cgi-bin/upload?sid=",getTop().getSid()]
.join("");
}





function bcP()
{
var tS=arguments.callee;
return(tS.Uu||(tS.Uu=
{"sid":1,"username":1,"foxacc":1,

"m3gmsid":1,"mcookie":1,"msid":1,"defaultf":1,
"qm_flag":1,"QFRIENDUNREADCNT":1,"RSSUNREADCNT":1,"rss_domain":1,"qqmail_activated":1,"qqmail_alias_default":1,
"qqmail_from":1,"wimrefreshrun":1,"new":1,"qm_sk":1,"qm_ssum":1,"qq2self_sid":1,"exstype":1,"lockurl":1,"new_mail_num":1})
);
}

function setUserCookie(aD,bJ,mQ,eP,kK,pL)
{







if(bcP()[aD]==1)
{
var pP=getCookie(aD),
eD=pP?pP.split("|"):[],
dO=getUin(),
bV=dO+"&"+bJ,
ee=true;


for(var i=0;i<eD.length;i++)
{
if(eD[i].match(dO))
{
eD[i]=bV;
ee=false;
}
}

pP=eD.join("|");
ee&&(pP+=(pP==""?"":"|")+bV);
return setCookie(aD,pP,mQ,eP,kK,pL);
}
else
return setCookie(aD,bJ,mQ,eP,kK,pL);

}





function getUserCookie(aD)
{




var gy=getCookie(aD);

if(bcP()[aD]!=1)
{
return gy;
}
else
{
var eD=gy?gy.split("|"):[],
dO=getUin();

for(var i=0;i<eD.length;i++)
{
if(eD[i].match(dO))
{
return((eD[i].split("&"))[1]||eD[i]);
}
}
return gy;
}

}




function deleteUserCookie(aD,eP,kK)
{
deleteCookie(aD,eP,kK);
}





function setUserCookieFlag(aD,dk,CB,aBc)
{
return setCookieFlag(aD,dk,CB,aBc)
}





function getUserCookieFlag(aD)
{
return getCookieFlag(aD);
}








function getReaderData(bj)
{
if(window!=getTop())
{
getTop().getReaderData(bj);
}
else
{
var yK=arguments.callee;
removeSelf(yK.jsObj);
yK.jsObj=loadJsFile(bj+"&r="+Math.random(),false,document);
}
}






function getReaderDataInterval(bj,Cu)
{
if(window!=getTop())
{
return getTop().getReaderDataInterval(bj,Cu);
}
else
{
var yK=arguments.callee,
aT=(window.gsRssDomain||'')+"/cgi-bin/reader_data2?sid="+getSid()+"&t=rss_data.js";

if(yK.nTimer)
{
clearInterval(yK.nTimer);
}

function LE()
{
getReaderData(aT);
}

yK.nTimer=setInterval(LE,Cu
||(window.gnRssInterval*1000)||(10*60*1000));
LE();
}
}


function changeStatus(aQO)
{
var bby=S("searchIcon");
bby&&setClass(bby,aQO?"ss_icon ss_fronticon ss_icon_loading":"ss_icon ss_fronticon ss_icon_search")
}





function doSearch()
{
QMPageInit.bcN(
function()
{
var fX=S("frmSearch");
fX.sender.value=fX.subject.value;
fX.receiver.value=fX.subject.value;
fX.keyword.value=fX.subject.value;
fX.combinetype.value="or";
submitToActionFrm(fX);
}
);
return false;
}





function audioPlay(aj)
{
var _oTop=getTop();
if(!aj.container)
{
aj.container=S('mp3player_container',_oTop.getMainWin());
}
if(aj.global&&!aj.globalcontainer)
{
aj.globalcontainer=S('gplayer_container',_oTop);
if(!aj.globalcontainer)
{
aj.global=false;
}
}

if(!_oTop.QMPlayer)
{

loadJsFileToTop(["$js_path$qmplayer/player0efbd6.js"]);
}
waitFor(
function()
{
return!!_oTop.QMPlayer;
},
function(aY)
{
if(aY)
{



var Wl="gplayer_kernel",
aQv=aj.id||("qmplayer_unique"+unikey());

function aMv()
{
var aU=Wl+"_dom";
if(_oTop.S(aU))
{
return _oTop.S(aU)
}
else
{
var _oDom=_oTop.document.createElement("div");
_oDom.id=aU;
_oDom.style.cssText="position:absolute;left:-100000px;";
_oTop.document.body.appendChild(_oDom);
return _oDom;
}
};

if(!aj.msg)
{
aj.msg="QQ\u90AE\u7BB1\u64AD\u653E\u5668";
}
if(aj.container&&aj.container.getElementsByTagName("div").length==0)
{
aj.container.innerHTML="";
}

if(aj.global)
{
var abE=QMPlayer.initKernel({
sId:Wl,
oContainer:aMv()
}),
aLL=QMPlayer.initSkin({
sId:Wl,
sSkin:"Global",




oContainer:aj.globalcontainer
});

_oTop.QMPlayer.init({
oSkin:aLL,
oKernel:abE
});
}

_oTop.QMPlayer.delUIById(aQv);

_oTop.QMPlayer.init({
oSkin:QMPlayer.initSkin({
sId:aQv,
oContainer:aj.container,
sSkin:aj.skin||"Mini"
}),
oKernel:aj.global?abE.setInfo(aj):QMPlayer.initKernel({
sId:aQv,
oContainer:aj.container,
oInfo:aj
})
});
}
else if(aj.container)
{
aj.container.innerHTML="\u64AD\u653E\u5668\u52A0\u8F7D\u5931\u8D25";
}
}
);
}




function audioStop()
{
var hV=getTop().QMPlayer;
hV&&hV.stop();
}














function setPlayer(aj)
{
var _oTop=getTop();

function aZU(aj)
{
if(!_oTop.QMPlayer)
{
setTimeout(function()
{
aZU(aj);
},200);
return false;
}

var aU="qqmailMediaPlayer"+(aj.id||""),
az=aj.win||window;

if(!az||az[aU])
{
return false;
}

if(!aj.container
&&!(aj.container=S("mp3player_container",az)))
{
return false;
}

return(az[aU]=new _oTop.QMPlayer()).setup(aj);
}

if(!_oTop.QMPlayer)
{

loadJsFile("$js_path$qmplayer0de70b.js",true,_oTop.document);
}

return aZU(aj);
}













function playUrl(jr)
{
var hV=(jr.win||window)["qqmailMediaPlayer"
+(jr.id||"")];

if(!hV)
{
setPlayer(jr);
}
else
{
hV.openUrl(jr.url,jr.dispInfo);
}
}









function stopUrl(jr)
{
if(!jr)
{
jr={};
}

try
{
(jr.win||window)["qqmailMediaPlayer"+(jr.id||"")].stop();
}
catch(bc)
{
}
}











function searchMusic(kY,lI,bC)
{
if(window!=getTop())
{
return getTop().searchMusic(kY,lI,bC);
}
kY=kY||"";
lI=lI||"";
var PB=arguments.callee,
aAo=[kY,lI].join("@");

PB.fCallBack=function(oI)
{
var _oList,
aT="",
alJ=[];
if(!oI.contentWindow.gMusicInfo||!(_oList=oI.contentWindow.gMusicInfo.list))
{
return bC(alJ);
}

for(var i=0,_nLen=_oList.length;i<_nLen;i++)
{
var _oInfo={
song:_oList[i].songname.replace(/<\/?strong>/gi,""),
singer:_oList[i].singername.replace(/<\/?strong>/gi,"")
},
aro=htmlDecode(_oList[i].songurl).replace(/\|/g,"").split(";");


for(var j=0,axu=aro.length;j<axu;j+=2)
{



if(aro[j]
&&aro[j].indexOf("qqmusic.qq.com")==-1)
{
_oInfo.url=aro[j].replace(/^(FI|SI|AN|QQ)/,"");
alJ.push(_oInfo);
break;
}
}
}
PB.OG[aAo]=alJ;
bC(alJ);
};

if(!kY&&!lI)
{
return bC([]);
}
if(!PB.OG)
{
PB.OG={};
}
if(PB.OG[aAo])
{
return bC(PB.OG[aAo]);
}

PB.dNd=createBlankIframe(getTop(),{
id:"getMusicUrlFromSoSo",
style:"display:none;",
virtual:false,
header:T(
[
'<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>',
'<script>',
'function searchJsonCallback(a)',
'{',
'window.gMusicInfo = a;',
'}',
'<\/script>',
'<script src="$domain$/fcgi-bin/fcg_search_xmldata.q?w=$song$%20$singer$&source=3&r=$rand$"><\/script>',
]
).replace(
{
domain:(location.protocol=="https:"?'https://qqshow.mail.qq.com':'http://cgi.music.soso.com'),
song:encodeURI(kY),
singer:encodeURI(lI),
rand:Math.random()
}
),
destroy:true,
onload:function(ao)
{
searchMusic.fCallBack(this);
}
});
}








function getMusicUrl(kY,lI,bC)
{
searchMusic(kY,lI,function(CF)
{
if(CF.length>0)
{
var j=0,
acR=/\.mp3$/i;
for(var i=0;(gbIsMac||gbIsLinux)&&i<CF.length;i++)
{
if(acR.test(CF[i].url))
{
j=i;
break;
}
}
debug(CF[j].url);
bC(CF[j].song,CF[j].singer,CF[j].url,CF);
}
else
{
bC(kY,lI,"",CF);
}
},1);
}









function startWebpush(KK)
{
var _oTop=getTop();

_oTop.loadCssFile("$css_path$webpushtip0de489.css",true);

_oTop.loadJsFile("$js_path$qmwebpushtip0df70d.js",
true,
_oTop.document,
function()
{
_oTop.QMWebpushTip.open(KK);
}
);

_oTop.loadJsFile("$js_path$qmwebpush0df8ff.js",true,_oTop.document);
}







function closeWebpush(KK)
{
getTop().QMWebpushTip&&getTop().QMWebpushTip.close(KK,true);
}








function ftSendStatic(gp,ew)
{
if(gp)
{
ossLog("realtime","all",T('stat=exskick&sid=$sid$&uin=$uin$&log=$code$')
.replace(
{
uin:ew||getTop().g_uin,
sid:getSid(),
code:gp
}
));
}
}









function beginStatTime(ao)
{
var adA=parseInt(ao.location.hash.split("stattime=").pop());

if(!isNaN(adA)&&adA.toString().length==13&&adA>(getTop().gnStatTimeStamp||0))
{
ao.gnBeginTime=getTop().gnStatTimeStamp=adA;
ao.gnStatTimeStart=now();
}
}

















function endStatTime(ao,dv)
{
var AG=ao.gnBeginTime,
fk=ao.gnStatTimeStart,
he=now();

if(!isNaN(fk)&&!isNaN(AG))
{
addEvent(ao,"load",function()
{
var aBk=now();

ossLog("delay","sample",T(
[
'stat=cgipagespeed&type=$type$&t1=$t1$&t2=$t2$&t3=$t3$',
'&rcgi=$appname$&rt=$t$&rs=$s$&allt=$allt$&flowid=$wm_flowid$'
]
).replace(extend(dv,
{
t1:fk-AG,
t2:he-fk,
t3:aBk-he,
allt:[AG,fk,he,aBk].join("|")
}
)));
debug([fk-AG,he-fk,aBk-he],994919736);
}
);
}
}
















function ossLog()
{
var bgK=getTop().ossLog;
return bgK.aMJ.apply(bgK,arguments);
}

ossLog.aMJ=function(abL,AQ,qV,azz)
{
var ae=this,
abh=abL||"realtime",
IG=ae.aeR(qV),
lF=ae.lF||(ae.lF=[]),
hG=typeof AQ=="number"?AQ:{all:1}[AQ||"all"]||0.1;
log("ossLog:::: ",IG);

if(abh=="realtime")
{
ae.JV(hG)&&ae.azN(IG);
}

else
{

ae.JV(hG)
&&lF.push(["delayurl","=",encodeURIComponent(IG)].join(""));

lF.length>=1000?ae.azN()

:(!ae.dE&&lF.length>0&&(ae.dE=setTimeout(ae.azN,5*1000)));
}
};

ossLog.azN=function(FY)
{
var ae=ossLog,
lF=ae.lF;
if(FY||lF.length>0)
{
QMAjax.send("/cgi-bin/getinvestigate",
{
method:"POST",
timeout:500,
content:T('sid=$sid$&$rl$&$ls$').replace(
{
sid:getSid(),
rl:FY,
ls:lF.join("&")
}
)
}
);
lF.length=0;
ae.dE&&clearTimeout(ae.dE);
ae.dE=null;
}
};

ossLog.JV=function(lz)
{
return(this.Js||(this.Js=now()))%100<100*lz;
};

ossLog.aeR=function(qV)
{
var jC=[];
typeof qV=="string"
?jC.push("&",qV)
:E(qV,function(nz,bn)
{
jC.push("&",bn,"=",encodeURIComponent(nz));
}
);
return jC.shift()&&jC.join("");
};










function isdLog(bZS,bn,nz)
{
var sk=T([
window.location.protocol,
"//isdspeed.qq.com/cgi-bin/r.cgi?flag1=6000&flag2=101&flag3=$flag$&$key$=$value$&r=$r$"
]),
fx=new Image();

setTimeout(function()
{
fx.src=sk.replace({
flag:bZS,
key:bn,
value:nz||"1",
r:Math.random()
});
}
);
}




var AD=
{
bmU:"",
init:function(ao)
{
var ae=this;
ao["AD_callback"]=function(ap)
{
if(ae.bmU!="timeout")
{
ae.bmU="ok";
for(var i=0;i<ap.length;i++)
{
var aG=ap[i]&&ap[i][0];
if(aG)
{
var Fb=aG.loc,
bxw=aG.oid,
cSx=aG.fodder,cPh=T("loc=ad_today,$loc$,$oid$,$hit$");
if(bxw=="1"||bxw=="100")
{
ae.cuV(ao,Fb);
ossLog("realtime",1/100,cPh.replace(
{
loc:Fb,
oid:bxw,
hit:0
}
));
}
else if(cSx[0]&&Fb)
{
ossLog("realtime",1/100,cPh.replace(
{
loc:Fb,
oid:bxw,
hit:1
}
));
ae.dCU(ao,extend(cSx[0],{cid:aG.cid,loc:aG.loc,oid:aG.oid}),Fb)
}
else
{
debug("No AD loc or DATA")
}
}
else
{
debug("no AD")
}
}
}

};

















this.dJH(ao);
},
postADlog:function(dFZ,fE,bj,_aoEvent)
{
if(dFZ=="flash")
{
var eb=getEventTarget(_aoEvent);
if(eb.tagName=="DIV")
{
ossLog("realtime","all",T('stat=log_ad_click&pos=$pos$')
.replace(
{
pos:fE
}
));
bj&&window.open(bj);
}
}
else
{
ossLog("realtime","all",T('stat=log_ad_click&pos=$pos$')
.replace(
{
pos:fE
}
));
}
},

setAdFlag:function()
{
setCookieFlag("CCSHOW",5,getTop().document.body.clientWidth<1152?0:1);
},
adjustADDisp:function()
{
var cy=getTop().getMainWin(),
cba=S("qqmail_AD_container",cy),
_oContainer=S("qqmail_mailcontainer",cy);
rdVer("BaseVer",1);
if(this.cnR()=="0"&&isShow(cba))
{
cba&&(show(cba,0));
}













},
cnR:function()
{
return getCookieFlag("CCSHOW")[5];
},
dTt:function(bj)
{
var Jg=strReplace(bj,"http://",""),
aaw=Jg.indexOf("/"),
_sDomain=Jg.substr(0,aaw),
efx="https://stockweb.mail.qq.com";
return strReplace(bj,"http://"+_sDomain,efx)+"?pdomain="+_sDomain;
},
dta:function(ek)
{























var	dzm=TE([
'<span style="background:url($pingurl$);"></span>',
'<a href="$link_to$" target="_blank"  onclick="getTop().AD.postADlog(\'img\',\'$pos$\')" ',
'style="white-space: nowrap; height:80px; overflow: hidden; display: block; margin-bottom:3px; background:url($resource_url$) no-repeat;"></a>']),
efW=TE([
'<a href="$link_to$" target="_blank" style="background:url($pingurl$);" onclick="getTop().AD.postADlog(\'img\',\'$pos$\')">',
'<img src="$resource_url$" width="$width$" height="$height$">',
'</a>',
'<style>',
'.ad_btn_close{position:absolute; top:5px; right:5px; line-height:0; text-decoration:none; background:#aaa; width:12px; height:12px;  border:1px solid #999;}',
'.ad_btn_close:hover{border-color:#888;background-color:#999;}',
'</style>',
'$@$if($bCloseBtn$)$@$',
' <a class="ad_btn_close" onclick="closeAD(\'$pos$\')"><img src="$img_path$ico_closetip.gif"></a>',
'$@$endif$@$',
]);




if(ek==1)
{
return dzm;
}
else if(ek==2)
{
return efW;
}
},
dCU:function(ao,ah,oK,bL)
{
var _oDom=this.bTT(ao,oK),
brc=location.protocol=="https:",
dyM=brc?T("https://stockweb.mail.qq.com/p?oid=$oid$&cid=$cid$&loc=$loc$&pdomain=p.l.qq.com")
:T("http://p.l.qq.com/p?oid=$oid$&cid=$cid$&loc=$loc$"),
dNA=attr(_oDom,"bgimg")=="1"?true:false,
dMS=attr(_oDom,"closebtn")=="1"?true:false,
efh=attr(_oDom,"pos");
if(_oDom&&ah.resource_url)
{
var cNp=_oDom.parentNode;
brc&&(ah.resource_url=this.dTt(ah.resource_url));






var dSB=this.dta(dNA?1:2);


show(cNp,1);
setHTML(cNp,dSB.replace(extend(ah,
{
img_path:getPath("image"),
bIsIE:gbIsIE,
bCloseBtn:dMS,
pingurl:dyM.replace(ah),
pos:efh
})));
}
else
{
debug("no loc dom")
}
},
bTT:function(ao,oK)
{
var dg=null;
E(GelTags("qqmailad",ao.document),function(_aoDom)
{
dFy=attr(_aoDom,"loc")||"";
if(dFy==oK)
{
dg=_aoDom;
}
});
return dg;
},
dJH:function(ao,aoR)
{
var bLl=[],aeY="",ae=this,
brc=location.protocol=="https:",
dTU=brc?T("https://stockweb.mail.qq.com/lview?c=www&loc=$loc$&callback=AD_callback&rot=1&pdomain=l.qq.com"):T("http://l.qq.com/lview?c=www&loc=$loc$&callback=AD_callback&rot=1");

E(GelTags("qqmailad",ao.document),function(_aoDom)
{
aeY=attr(_aoDom,"loc")||"";
if(aoR)
{
attr(_aoDom,"disp")=="0"&&aeY&&bLl.push(aeY)&&attr(_aoDom,"disp","1");
}
else
{
attr(_aoDom,"disp")!="0"&&aeY&&bLl.push(aeY);
}
});

aeY=bLl.join(",");


if(aeY)
{
setTimeout(function()
{

var _oDom=ae.bTT(ao,aeY);
if(_oDom)
{
var aCg=_oDom&&attr(_oDom,"ADDefault")||"";
if(aCg!=""&&S(aCg,ao))
{
if(!isShow(S(aCg,ao)))
{
show(S(aCg,ao),1);
}
}
}

},2.5*1000);

if(!(this.cnR()=="0"&&aeY=="qqmail_send_skyscraper"))
{
var eUV=loadJsFile(dTU.replace({loc:aeY}),false,ao.document);

setTimeout(function()
{
if(ae.bmU!="ok")
{
ae.bmU="timeout";
ae.cuV(ao,aeY);
ossLog("realtime","all","loc=ad_timeout,,,");
}
},2*1000);
}

}

},
cuV:function(ao,oK)
{
var _oDom=this.bTT(ao,oK),
aCg=_oDom&&attr(_oDom,"ADDefault")||"";
if(aCg!="")
{
_oDom&&_oDom.parentNode&&show(_oDom.parentNode,0);
show(S(aCg,ao),1);
}
}
};


function initAD(ao)
{
AD.init(ao);
}






function all_js(){}
